/* RQ Calc — dark fantasy theme: warm blacks, bronze frames, gold accents */
:root {
  --bg: #0b0a08;
  --bg-2: #100e0b;
  --panel: #16130f;
  --panel-2: #1c1813;
  --raise: #251f17;
  --raise-2: #2e261b;
  --line: rgba(var(--line-rgb), .16);
  --line-2: rgba(var(--line-rgb), .32);
  --line-3: rgba(var(--line-rgb), .55);
  --soft: rgba(240, 210, 150, .05);
  --fg: #eee4cf;
  --muted: #a89a80;
  --dim: #6f6553;
  --gold-rgb: 230, 184, 92;
  --line-rgb: 214, 168, 79;
  --p1: #f2c771;
  --p3: #a87a2f;
  --p-border: #f5d48c;
  --gold: #e6b85c;
  --gold-2: #c9963f;
  --gold-3: #8a6428;
  --gold-hi: #ffe2a0;
  --on-gold: #1d1407;
  --up: #86d46d;
  --down: #ec6b5e;
  --bad: #ec6b5e;
  --card: #c3a0ff;
  --bonus: #b9d89a;
  --f-display: "Palatino Linotype", "Book Antiqua", Palatino, Georgia, serif;
  --f-body: "Segoe UI", system-ui, sans-serif;
  --f-num: "Segoe UI", system-ui, sans-serif;
  --frame: inset 0 0 0 1px rgba(0, 0, 0, .55), inset 0 1px 0 rgba(255, 220, 150, .06);
  --glow: 0 0 0 1px var(--line-3), 0 0 14px rgba(var(--gold-rgb), .18);
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
html, body { margin: 0; height: 100%; color: var(--fg); font-family: var(--f-body); font-size: 13.5px; }
body {
  display: flex; flex-direction: column; overflow: hidden;
  background:
    radial-gradient(1200px 600px at 50% -10%, rgba(var(--gold-rgb), .07), transparent 60%),
    radial-gradient(900px 700px at 50% 120%, rgba(120, 60, 20, .10), transparent 60%),
    var(--bg);
}
button, input, select { font: inherit; color: inherit; }
::selection { background: rgba(var(--gold-rgb), .35); }
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-thumb { background: linear-gradient(var(--gold-3), #5c4420); border-radius: 6px; border: 3px solid transparent; background-clip: padding-box; }
::-webkit-scrollbar-thumb:hover { background: linear-gradient(var(--gold-2), var(--gold-3)); background-clip: padding-box; border: 3px solid transparent; }
::-webkit-scrollbar-track { background: transparent; }
.num, .tile .v, .st .vl, .free b, .tal-head .pts { font-variant-numeric: tabular-nums; }

/* ---------- top bar ---------- */
.top {
  display: flex; align-items: center; gap: 8px; padding: 9px 16px;
  background: linear-gradient(180deg, #1d1812, #120f0b);
  border-bottom: 1px solid var(--line-2);
  box-shadow: 0 1px 0 rgba(0, 0, 0, .6), 0 6px 18px rgba(0, 0, 0, .35);
  position: relative; z-index: 5;
}
.top::after { content: ''; position: absolute; left: 0; right: 0; bottom: -1px; height: 1px; background: linear-gradient(90deg, transparent, var(--gold-2) 30%, var(--gold-hi) 50%, var(--gold-2) 70%, transparent); opacity: .55; }
.brand { font-family: var(--f-display); font-weight: 700; font-size: 19px; letter-spacing: .03em; margin-right: 12px; white-space: nowrap; color: var(--gold); text-shadow: 0 1px 0 #000, 0 0 18px rgba(var(--gold-rgb), .25); }
.logo { color: var(--gold-hi); display: inline-block; transform: translateY(-1px); }
.build-name { width: 250px; padding: 6px 11px; background: rgba(0, 0, 0, .35); border: 1px solid var(--line); border-radius: 6px; outline: none; box-shadow: inset 0 1px 3px rgba(0, 0, 0, .6); }
.build-name:focus { border-color: var(--line-3); }
.spacer { flex: 1; }
.btn {
  padding: 6px 13px; border-radius: 6px; cursor: pointer; white-space: nowrap; font-weight: 600; font-size: 13px;
  background: linear-gradient(180deg, #2c2419, #1d1811); border: 1px solid var(--line-2); color: var(--fg);
  box-shadow: inset 0 1px 0 rgba(255, 225, 160, .08), 0 1px 2px rgba(0, 0, 0, .5);
  transition: border-color .12s, box-shadow .12s, filter .12s;
}
.btn:hover { border-color: var(--line-3); box-shadow: inset 0 1px 0 rgba(255, 225, 160, .12), 0 0 10px rgba(var(--gold-rgb), .15); }
.btn:active { filter: brightness(.92); }
.btn.primary { background: linear-gradient(180deg, var(--p1), var(--gold-2) 55%, var(--p3)); color: var(--on-gold); border-color: var(--p-border); text-shadow: 0 1px 0 rgba(255, 240, 200, .4); }
.btn.primary:hover { filter: brightness(1.07); box-shadow: 0 0 14px rgba(var(--gold-rgb), .35); }
.btn.small { padding: 3px 10px; font-size: 12px; }
.btn.ghost { background: transparent; box-shadow: none; }
.btn.danger:hover { border-color: var(--bad); color: var(--bad); box-shadow: none; }
.lang { display: flex; gap: 2px; background: rgba(0, 0, 0, .35); border: 1px solid var(--line); border-radius: 6px; padding: 2px; }
.lang button { background: none; border: 0; padding: 3px 9px; border-radius: 4px; cursor: pointer; color: var(--dim); font-size: 11.5px; font-weight: 700; letter-spacing: .04em; }
.lang button:hover { color: var(--muted); }
.lang button.on { background: linear-gradient(180deg, #3a2f20, #2a2218); color: var(--gold); box-shadow: inset 0 0 0 1px var(--line-2); }
.dropdown { position: relative; }
.menu { position: absolute; top: calc(100% + 6px); left: 0; z-index: 50; min-width: 330px; max-height: 440px; overflow: auto; background: linear-gradient(180deg, #211b14, #17130e); border: 1px solid var(--line-2); border-radius: 8px; padding: 6px; box-shadow: 0 16px 40px rgba(0, 0, 0, .6), var(--frame); }
.menu .row { display: flex; align-items: center; gap: 10px; padding: 6px 8px; border-radius: 6px; }
.menu .row:hover { background: var(--soft); }
.menu .row .nm { flex: 1; cursor: pointer; font-weight: 600; }
.menu .row .sub { color: var(--dim); font-size: 11.5px; font-weight: 400; }
.menu .empty { color: var(--muted); padding: 12px; }
.menu img.mini { border: 1px solid var(--line-2); }

/* ---------- layout ---------- */
.layout { flex: 1; display: grid; grid-template-columns: 296px minmax(440px, 1fr) 350px; min-height: 0; }
.col { min-height: 0; overflow: auto; }
.left, .right { padding: 14px 12px; background: linear-gradient(180deg, rgba(28, 23, 17, .85), rgba(16, 13, 10, .9)); }
.left { border-right: 1px solid var(--line); box-shadow: inset -12px 0 18px -14px rgba(0, 0, 0, .8); }
.right { border-left: 1px solid var(--line); box-shadow: inset 12px 0 18px -14px rgba(0, 0, 0, .8); }
.center { display: flex; flex-direction: column; overflow: hidden; }
.tabs { display: flex; gap: 2px; padding: 12px 16px 0; border-bottom: 1px solid var(--line-2); background: linear-gradient(180deg, transparent, rgba(0, 0, 0, .25)); }
.tab {
  position: relative; padding: 8px 18px 9px; border: 1px solid transparent; border-bottom: 0; border-radius: 8px 8px 0 0; cursor: pointer;
  color: var(--muted); background: none; font-family: var(--f-display); font-weight: 700; font-size: 14.5px; letter-spacing: .02em;
}
.tab:hover { color: var(--fg); }
.tab.on { color: var(--gold); background: linear-gradient(180deg, #2a2219, #1c1813); border-color: var(--line-2); margin-bottom: -1px; box-shadow: inset 0 1px 0 rgba(255, 225, 160, .1); }
.tab.on::before { content: ''; position: absolute; left: 14px; right: 14px; top: -1px; height: 2px; background: linear-gradient(90deg, transparent, var(--gold), transparent); }
.tab .n { font-family: var(--f-body); font-size: 11px; font-weight: 700; color: var(--on-gold); background: var(--gold-3); border-radius: 8px; padding: 0 6px; margin-left: 7px; vertical-align: 1px; }
.tab.on .n { background: var(--gold-2); }
.tab-body { flex: 1; overflow: auto; padding: 16px; background: linear-gradient(180deg, #1c1813, #141109); }

h3 { font-family: var(--f-display); font-size: 16px; margin: 2px 0 12px; letter-spacing: .03em; color: var(--gold); display: flex; align-items: center; gap: 8px; text-shadow: 0 1px 0 #000; }
h3::before { content: '◆'; font-size: 9px; color: var(--gold-2); }
h3::after { content: ''; flex: 1; height: 1px; background: linear-gradient(90deg, var(--line-2), transparent); }
.res-head h3::after, .tal-head h3::after { display: none; }
h4 { font-size: 11px; text-transform: uppercase; letter-spacing: .1em; color: var(--muted); margin: 16px 0 7px; font-weight: 700; display: flex; align-items: center; gap: 8px; }
h4::after { content: ''; flex: 1; height: 1px; background: linear-gradient(90deg, var(--line), transparent); }
.box {
  position: relative; background: linear-gradient(180deg, #1f1a14, #16130e); border: 1px solid var(--line-2); border-radius: 8px; padding: 13px; margin-bottom: 12px;
  box-shadow: var(--frame), 0 3px 10px rgba(0, 0, 0, .35);
}
.box::before, .box::after { content: ''; position: absolute; width: 10px; height: 10px; border: 1px solid var(--gold-2); opacity: .7; pointer-events: none; }
.box::before { top: 3px; left: 3px; border-right: 0; border-bottom: 0; border-radius: 3px 0 0 0; }
.box::after { bottom: 3px; right: 3px; border-left: 0; border-top: 0; border-radius: 0 0 3px 0; }
.field { display: grid; grid-template-columns: 96px minmax(0, 1fr); align-items: center; gap: 8px; margin-bottom: 9px; }
.field > * { min-width: 0; }
.field > label { color: var(--muted); font-size: 12.5px; }
select, .inp { width: 100%; padding: 5px 9px; background: rgba(0, 0, 0, .35); border: 1px solid var(--line); border-radius: 6px; outline: none; box-shadow: inset 0 1px 3px rgba(0, 0, 0, .5); }
select:hover, .inp:hover { border-color: var(--line-2); }
select:focus, .inp:focus { border-color: var(--line-3); }
select option, select optgroup { background: #1c1813; color: var(--fg); }
.seg { display: flex; background: rgba(0, 0, 0, .35); border: 1px solid var(--line); border-radius: 6px; padding: 2px; }
.seg button { flex: 1; background: none; border: 0; padding: 4px 6px; border-radius: 4px; cursor: pointer; color: var(--dim); font-size: 12.5px; font-weight: 600; }
.seg button:hover { color: var(--muted); }
.seg button.on { background: linear-gradient(180deg, #3a2f20, #2a2218); color: var(--gold); box-shadow: inset 0 0 0 1px var(--line-2); }
.check { display: flex; align-items: center; gap: 8px; cursor: pointer; color: var(--fg); font-size: 12.5px; margin: 6px 0; user-select: none; }
input[type=checkbox], input[type=radio] { accent-color: var(--gold-2); width: 15px; height: 15px; margin: 0; cursor: pointer; }
input[type=range] { accent-color: var(--gold-2); }
.level-row { display: flex; align-items: center; gap: 8px; }
.level-row input[type=range] { flex: 1; min-width: 0; }
.level-row .inp { width: 56px; text-align: center; font-weight: 700; color: var(--gold); }
.class-head { display: flex; align-items: center; gap: 12px; margin-bottom: 12px; }
.class-head img { width: 50px; height: 50px; border-radius: 8px; border: 1px solid var(--line-3); background: radial-gradient(circle, #3a2d1a, #120f0b); box-shadow: 0 0 12px rgba(var(--gold-rgb), .2); padding: 2px; }
.class-head .nm { font-family: var(--f-display); font-size: 19px; font-weight: 700; color: var(--gold); text-shadow: 0 1px 0 #000; }
.class-head .sub { color: var(--muted); font-size: 12px; }

/* stats editor */
.stat-row { display: grid; grid-template-columns: 1fr 26px 54px 26px; gap: 4px; align-items: center; margin-bottom: 6px; }
.stat-row .nm { font-size: 13px; }
.stat-row .nm.primary { color: var(--gold); font-weight: 700; }
.stat-row .nm.primary::before { content: '★ '; font-size: 10px; color: var(--gold-2); }
.stat-row button { height: 26px; background: linear-gradient(180deg, #30271b, #1f1912); border: 1px solid var(--line-2); border-radius: 5px; cursor: pointer; font-weight: 800; color: var(--gold); line-height: 1; }
.stat-row button:hover { border-color: var(--line-3); box-shadow: 0 0 8px rgba(var(--gold-rgb), .2); }
.stat-row button:disabled { opacity: .3; cursor: default; box-shadow: none; }
.stat-row input { text-align: center; font-weight: 700; padding: 4px 2px; }
.free { display: flex; justify-content: space-between; align-items: center; margin-top: 10px; padding-top: 9px; border-top: 1px solid var(--line); font-size: 12.5px; color: var(--muted); }
.free b { font-size: 16px; color: var(--gold); margin-left: 4px; }
.free b.neg { color: var(--bad); }
.hint { color: var(--dim); font-size: 11.5px; margin-top: 6px; line-height: 1.4; }

/* ---------- inventory slots ---------- */
.gear { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 8px; }
.slot {
  display: grid; grid-template-columns: 50px 1fr; gap: 11px; padding: 9px 10px; cursor: pointer; min-height: 70px;
  background: linear-gradient(180deg, #211b14, #17130e); border: 1px solid var(--line); border-radius: 8px;
  box-shadow: var(--frame); transition: border-color .12s, box-shadow .12s, transform .12s;
}
.slot:hover { border-color: var(--line-3); box-shadow: var(--frame), 0 0 14px rgba(var(--gold-rgb), .16); }
.slot.off { opacity: .42; }
.slot.bad { border-color: rgba(236, 107, 94, .65); }
.slot.locked { cursor: default; opacity: .32; }
.slot.locked:hover { border-color: var(--line); box-shadow: var(--frame); }
.ico {
  width: 50px; height: 50px; border-radius: 6px; position: relative; background-color: #0e0c09; background-position: center; background-size: 44px 44px; background-repeat: no-repeat;
  border: 1px solid #5b4524; box-shadow: inset 0 0 0 1px #000, inset 0 0 10px rgba(0, 0, 0, .9), 0 1px 0 rgba(255, 225, 160, .06);
}
.slot:hover .ico { border-color: var(--gold-2); }
.ico .up { position: absolute; right: -5px; bottom: -6px; background: linear-gradient(180deg, #ffd98a, #d39c3d); color: var(--on-gold); font-size: 10.5px; font-weight: 800; padding: 0 5px; border-radius: 4px; border: 1px solid #fff0c4; box-shadow: 0 1px 3px rgba(0, 0, 0, .7); }
.slot .sn { font-size: 10.5px; color: var(--dim); text-transform: uppercase; letter-spacing: .08em; font-weight: 700; }
.slot .in { font-weight: 600; margin: 1px 0 4px; line-height: 1.25; color: var(--fg); }
.slot .in.none { color: var(--dim); font-weight: 400; font-style: italic; }
.chips { display: flex; flex-wrap: wrap; gap: 4px; }
.chip { font-size: 11px; padding: 1px 7px; border-radius: 10px; background: rgba(0, 0, 0, .3); border: 1px solid var(--line); color: var(--muted); white-space: nowrap; max-width: 100%; overflow: hidden; text-overflow: ellipsis; }
.chip.card { color: var(--card); border-color: rgba(195, 160, 255, .28); background: rgba(120, 80, 200, .08); }
.chip.stamp { display: inline-flex; align-items: center; gap: 5px; color: var(--fg); }
.dot { width: 9px; height: 9px; border-radius: 50%; display: inline-block; flex: none; box-shadow: 0 0 0 1px rgba(0, 0, 0, .6), 0 0 6px currentColor; }
.warn { color: var(--bad); font-size: 11.5px; }

/* character window (like the in-game one) */
.gear-layout { display: flex; height: 100%; min-height: 520px; }
.charwin-wrap { flex: 1; display: flex; flex-direction: column; gap: 10px; min-width: 0; }
.charwin {
  --s: 62px;
  flex: 1; --s: 64px; display: grid; grid-template-columns: var(--s) var(--mw, calc(var(--s) * 3.45)) var(--s) var(--s); grid-template-rows: repeat(7, var(--s)); column-gap: var(--gx, 6px); row-gap: var(--gy, 6px); justify-content: center; align-content: center;
  padding: 12px; border: 1px solid var(--line-3); border-radius: 10px;
  background: linear-gradient(180deg, #221c15, #15120d);
  box-shadow: var(--frame), 0 6px 20px rgba(0, 0, 0, .45);
}
.gslot {
  position: relative; width: var(--s, 62px); height: var(--s, 62px); border-radius: 6px; cursor: pointer;
  background: radial-gradient(circle at 50% 40%, #2a241c, #100d0a 75%);
  border: 1px solid #4d3b20;
  box-shadow: inset 0 0 0 1px #000, inset 0 0 14px rgba(0, 0, 0, .95), 0 1px 0 rgba(255, 225, 160, .05);
  transition: border-color .12s, box-shadow .12s;
}
.gslot:hover { border-color: var(--gold); box-shadow: inset 0 0 0 1px #000, inset 0 0 14px rgba(0, 0, 0, .9), 0 0 12px rgba(var(--gold-rgb), .35); }
.gs-img { position: absolute; inset: 5px; background: center / contain no-repeat; opacity: .16; filter: grayscale(1) brightness(1.6); }
.gslot.full .gs-img { inset: 4px; opacity: 1; filter: none; }
.gslot.full { border-color: #7a5a2a; }
.gslot.off { opacity: .4; }
.gslot.bad { border-color: var(--bad); }
.gslot.locked { cursor: default; opacity: .3; }
.gs-up { position: absolute; right: -5px; bottom: -6px; background: linear-gradient(180deg, #ffd98a, #d39c3d); color: var(--on-gold); font-size: calc(var(--s) * .17); font-weight: 800; padding: 0 4px; border-radius: 4px; border: 1px solid #fff0c4; box-shadow: 0 1px 3px rgba(0, 0, 0, .7); }
.gs-stamp { position: absolute; left: 4px; top: 4px; width: calc(var(--s) * .15); height: calc(var(--s) * .15); border-radius: 50%; box-shadow: 0 0 0 1px #000, 0 0 6px rgba(255, 255, 255, .35); }
.gs-cards { position: absolute; left: 4px; bottom: 2px; font-size: calc(var(--s) * .13); letter-spacing: 1px; color: var(--card); text-shadow: 0 0 3px #000, 0 0 3px #000; }
.model {
  position: relative; display: flex; flex-direction: column; align-items: center; overflow: hidden; cursor: pointer;
  border: 1px solid #4d3b20; border-radius: 6px;
  background:
    radial-gradient(ellipse 65% 50% at 50% 48%, rgba(var(--gold-rgb), .12), transparent 70%),
    repeating-linear-gradient(0deg, rgba(0, 0, 0, .18) 0 1px, transparent 1px 34px),
    repeating-linear-gradient(90deg, rgba(0, 0, 0, .12) 0 1px, transparent 1px 58px),
    linear-gradient(180deg, #2b2620, #1a1712 70%, #12100c);
  box-shadow: inset 0 0 0 1px #000, inset 0 0 30px rgba(0, 0, 0, .8);
}
.model:hover { border-color: var(--gold-2); }
.model-cap { position: relative; z-index: 2; text-align: center; padding: 10px 0 0; max-width: calc(100% - 2 * (var(--s) + 12px)); }
.mc-name { font-family: var(--f-display); font-weight: 700; font-size: calc(var(--s) * .29); color: var(--fg); text-shadow: 0 1px 2px #000; }
.mc-sub { font-size: calc(var(--s) * .19); color: var(--muted); text-shadow: 0 1px 2px #000; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.model-fig { position: absolute; bottom: 22px; left: 50%; transform: translateX(-50%); height: 78%; z-index: 1; filter: drop-shadow(0 10px 10px rgba(0, 0, 0, .7)); }
.model-fig.silhouette { filter: brightness(0) invert(.2) sepia(.9) saturate(1.5) drop-shadow(0 0 12px rgba(var(--gold-rgb), .3)); opacity: .9; }
.model-floor { position: absolute; left: 0; right: 0; bottom: 0; height: 22%; z-index: 0; background: linear-gradient(180deg, transparent, rgba(6, 5, 3, .85)); }
.gs-emblem { display: flex; align-items: center; justify-content: center; }
.gs-emblem img { height: calc(var(--s) * .9); opacity: .55; filter: sepia(.4) drop-shadow(0 2px 4px #000); }
.decor { padding: 10px 12px 12px; border: 1px solid var(--line-2); border-radius: 10px; background: linear-gradient(180deg, #1f1a14, #15120d); box-shadow: var(--frame); }
.decor-title { font-family: var(--f-display); font-weight: 700; color: var(--gold); margin-bottom: 8px; font-size: 14.5px; }
.decor-list { display: flex; flex-direction: column; gap: 6px; }
.decor-row { display: flex; gap: 10px; margin-top: 8px; }
.decor .slot { min-height: 0; padding: 7px 9px; grid-template-columns: 42px 1fr; }
.decor .ico { width: 42px; height: 42px; background-size: 36px 36px; }

/* ---------- dialogs ---------- */
.modal { position: fixed; inset: 0; background: rgba(5, 4, 2, .7); display: flex; align-items: center; justify-content: center; z-index: 40; backdrop-filter: blur(2px); }
.dialog {
  width: min(1060px, calc(100vw - 40px)); height: min(740px, calc(100vh - 40px)); display: flex; flex-direction: column; overflow: hidden;
  background: linear-gradient(180deg, #1f1a13, #141109); border: 1px solid var(--line-3); border-radius: 10px;
  box-shadow: 0 24px 70px rgba(0, 0, 0, .7), var(--frame);
}
.dialog.narrow { width: min(580px, calc(100vw - 40px)); height: auto; }
.dialog-head { display: flex; align-items: center; gap: 10px; padding: 12px 16px; border-bottom: 1px solid var(--line-2); background: linear-gradient(180deg, #2a2219, #1d1812); }
.dialog-head h3 { margin: 0; flex: 1; font-size: 17px; }
.dialog-body { flex: 1; display: grid; grid-template-columns: 390px 1fr; min-height: 0; }
.dialog.narrow .dialog-body { display: block; padding: 16px; }
.dialog-foot { display: flex; gap: 8px; justify-content: flex-end; padding: 10px 16px; border-top: 1px solid var(--line-2); background: rgba(0, 0, 0, .2); }
.picker { display: flex; flex-direction: column; border-right: 1px solid var(--line); min-height: 0; background: rgba(0, 0, 0, .18); }
.picker .inp { margin: 10px; width: auto; }
.list { flex: 1; overflow: auto; padding: 0 6px 8px; }
.li { display: grid; grid-template-columns: 38px 1fr auto; gap: 10px; align-items: center; padding: 5px 8px; border-radius: 6px; cursor: pointer; border: 1px solid transparent; }
.li:hover { background: var(--soft); }
.li.on { background: linear-gradient(90deg, rgba(var(--gold-rgb), .16), rgba(var(--gold-rgb), .04)); border-color: var(--line-2); }
.li img, .li .ph { width: 38px; height: 38px; border-radius: 5px; border: 1px solid #5b4524; background: #0e0c09; box-shadow: inset 0 0 6px #000; }
.li .t { font-size: 13px; line-height: 1.2; font-weight: 600; }
.li .s { font-size: 11.5px; color: var(--dim); }
.li .lv { font-size: 12px; font-weight: 700; color: var(--gold-2); }
.detail { padding: 16px 20px; overflow: auto; }
.detail .head { display: flex; gap: 16px; align-items: center; margin-bottom: 14px; padding-bottom: 14px; border-bottom: 1px solid var(--line); }
.detail .head img { width: 72px; height: 72px; border-radius: 8px; border: 1px solid var(--gold-2); background: radial-gradient(circle, #33281a, #0e0c09); box-shadow: 0 0 16px rgba(var(--gold-rgb), .2); padding: 3px; }
.detail .head .nm { font-family: var(--f-display); font-size: 21px; font-weight: 700; color: var(--gold); text-shadow: 0 1px 0 #000; }
.detail .head .sub { color: var(--muted); font-size: 12.5px; margin-top: 3px; }
.kv { display: flex; gap: 10px; margin: 6px 0 10px; flex-wrap: wrap; }
.kv div { font-size: 11px; color: var(--muted); text-transform: uppercase; letter-spacing: .06em; background: rgba(0, 0, 0, .3); border: 1px solid var(--line); border-radius: 6px; padding: 6px 12px; }
.kv b { display: block; font-size: 18px; color: var(--fg); text-transform: none; letter-spacing: 0; font-variant-numeric: tabular-nums; }
.bonus-list { margin: 0; padding: 0; list-style: none; }
.bonus-list li { padding: 3px 0 3px 14px; font-size: 13px; color: var(--bonus); white-space: pre-line; position: relative; }
.bonus-list li::before { content: '•'; position: absolute; left: 2px; color: var(--gold-3); }
.bonus-list li.muted { color: var(--muted); }
.upg { display: flex; flex-wrap: wrap; gap: 4px; }
.upg button { min-width: 36px; padding: 4px 6px; background: linear-gradient(180deg, #261f16, #18140e); border: 1px solid var(--line); border-radius: 5px; cursor: pointer; font-size: 12px; font-weight: 700; color: var(--muted); }
.upg button:hover { border-color: var(--line-3); color: var(--fg); }
.upg button.on { background: linear-gradient(180deg, var(--p1), var(--gold-2)); border-color: #fff0c4; color: var(--on-gold); box-shadow: 0 0 10px rgba(var(--gold-rgb), .4); }
.colors { display: flex; gap: 8px; margin-top: 8px; }
.colors button { width: 26px; height: 26px; border-radius: 50%; border: 2px solid rgba(0, 0, 0, .6); cursor: pointer; box-shadow: inset 0 2px 4px rgba(255, 255, 255, .3), inset 0 -3px 5px rgba(0, 0, 0, .35); }
.colors button.on { border-color: var(--gold-hi); box-shadow: 0 0 0 2px #000, 0 0 10px rgba(255, 226, 160, .6), inset 0 2px 4px rgba(255, 255, 255, .3); }
.card-row { display: grid; grid-template-columns: 22px 1fr; gap: 8px; align-items: start; margin-bottom: 6px; }
.card-row .n { color: var(--gold-2); font-weight: 800; font-size: 12px; text-align: center; padding-top: 8px; }
.sub-note { color: var(--gold-2); font-size: 11.5px; margin-top: 6px; }

/* picker with descriptions */
.pickbtn { width: 100%; display: flex; align-items: flex-start; gap: 8px; text-align: left; padding: 7px 11px; background: rgba(0, 0, 0, .32); border: 1px solid var(--line); border-radius: 6px; cursor: pointer; box-shadow: inset 0 1px 3px rgba(0, 0, 0, .45); }
.pickbtn:hover { border-color: var(--line-3); }
.pickbtn.fixed { cursor: default; opacity: .85; }
.pickbtn.fixed:hover { border-color: var(--line); }
.pickbtn .dot { margin-top: 5px; }
.pb-main { flex: 1; min-width: 0; }
.pb-name { font-size: 13px; font-weight: 600; }
.pb-name.none { color: var(--dim); font-weight: 400; font-style: italic; }
.pb-sub { font-size: 12px; color: var(--bonus); white-space: pre-line; line-height: 1.38; margin-top: 2px; }
.pb-arrow { color: var(--gold-2); margin-top: 1px; }
.pop { position: fixed; z-index: 70; display: flex; flex-direction: column; background: linear-gradient(180deg, #221c14, #17130e); border: 1px solid var(--line-3); border-radius: 8px; box-shadow: 0 16px 40px rgba(0, 0, 0, .65), var(--frame); overflow: hidden; }
.pop > .inp { margin: 8px; width: auto; }
.pop-list { overflow: auto; padding: 0 6px 6px; }
.pop-group { font-size: 10.5px; text-transform: uppercase; letter-spacing: .1em; color: var(--gold-2); font-weight: 700; padding: 10px 6px 4px; }
.pop-opt { display: flex; gap: 8px; padding: 6px 9px; border-radius: 6px; cursor: pointer; border: 1px solid transparent; }
.pop-opt:hover { background: var(--soft); }
.pop-opt.on { background: linear-gradient(90deg, rgba(var(--gold-rgb), .16), rgba(var(--gold-rgb), .04)); border-color: var(--line-2); }

/* ---------- talents ---------- */
.tal-head { display: flex; align-items: center; gap: 16px; margin-bottom: 12px; flex-wrap: wrap; }
.tal-head .pts { font-family: var(--f-display); font-size: 17px; font-weight: 700; }
.tal-head .pts b { color: var(--gold); font-size: 20px; }
.tal-head .pts b.neg { color: var(--bad); }
.branches { display: flex; flex-wrap: wrap; gap: 12px; align-items: flex-start; }
.branch { width: 240px; background: linear-gradient(180deg, #1f1a14, #15120d); border: 1px solid var(--line-2); border-radius: 8px; overflow: hidden; box-shadow: var(--frame), 0 3px 10px rgba(0, 0, 0, .35); padding-bottom: 4px; }
.branch .bh { padding: 9px 11px; font-weight: 700; font-family: var(--f-display); font-size: 15px; display: flex; justify-content: space-between; align-items: center; color: #fff4dc; text-shadow: 0 1px 2px #000; background-blend-mode: multiply; background-image: linear-gradient(180deg, rgba(255, 255, 255, .12), rgba(0, 0, 0, .35)); border-bottom: 1px solid rgba(0, 0, 0, .6); margin-bottom: 4px; }
.branch .bh span { font-family: var(--f-body); font-size: 11.5px; font-weight: 800; background: rgba(0, 0, 0, .4); border-radius: 8px; padding: 1px 8px; }
.trow { display: grid; grid-template-columns: 1fr 1fr; gap: 4px; padding: 2px 6px; }
.trow.single { grid-template-columns: 1fr; }
.talent { display: flex; align-items: center; gap: 7px; padding: 4px; border-radius: 6px; cursor: pointer; border: 1px solid transparent; min-width: 0; }
.talent img { width: 32px; height: 32px; border-radius: 5px; flex: none; border: 1px solid #3c2f1c; box-shadow: inset 0 0 4px #000; }
.talent .tn { font-size: 11.5px; line-height: 1.15; color: var(--dim); overflow: hidden; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.talent:hover { background: var(--soft); }
.talent:hover .tn { color: var(--muted); }
.talent.on { border-color: var(--line-3); background: linear-gradient(90deg, rgba(var(--gold-rgb), .18), rgba(var(--gold-rgb), .04)); }
.talent.on img { border-color: var(--gold); box-shadow: 0 0 8px rgba(var(--gold-rgb), .45); }
.talent.on .tn { color: var(--fg); font-weight: 600; }
.talent.locked { opacity: .35; cursor: default; }
.talent.locked:hover { background: none; }

/* ---------- effects ---------- */
.eff-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); gap: 12px; align-items: start; }
.eff-col { display: flex; flex-direction: column; gap: 12px; min-width: 0; }
.eff-col > .box { margin-bottom: 0; }
.opt { display: grid; grid-template-columns: 18px 32px 1fr auto; gap: 9px; align-items: center; padding: 5px 5px; border-radius: 6px; border: 1px solid transparent; }
.opt:hover { background: var(--soft); }
.opt:has(input:checked) { background: linear-gradient(90deg, rgba(var(--gold-rgb), .12), transparent); border-color: var(--line); }
.opt img, .opt .ph { width: 32px; height: 32px; border-radius: 5px; border: 1px solid #4a3920; background: #0e0c09; }
.opt .t { font-size: 13px; cursor: pointer; font-weight: 600; }
.opt .s { font-size: 11.5px; color: var(--bonus); opacity: .85; white-space: pre-line; }
.opt .stk { width: 58px; display: flex; align-items: center; gap: 4px; }
.opt .stk input { width: 50px; text-align: center; font-weight: 700; padding: 3px; }
.coll { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 3px 8px; }
.disabled-section { opacity: .4; filter: grayscale(.5); }

/* ---------- results ---------- */
.res-head { display: flex; align-items: center; gap: 8px; margin-bottom: 10px; }
.res-head h3 { margin: 0; flex: 1; font-size: 18px; }
.tiles { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; margin-bottom: 12px; }
.tile { background: linear-gradient(180deg, #211b14, #17130e); border: 1px solid var(--line); border-radius: 7px; padding: 8px 11px; min-width: 0; box-shadow: var(--frame); cursor: default; }
.tile:hover { border-color: var(--line-2); }
.tile .l { font-size: 10.5px; color: var(--muted); text-transform: uppercase; letter-spacing: .07em; font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tile .v { font-weight: 700; font-size: 19px; line-height: 1.3; white-space: nowrap; color: var(--fg); }
.tile .x { font-size: 11.5px; color: var(--gold-2); white-space: nowrap; }
.tile.big { grid-column: span 2; position: relative; text-align: center; padding: 12px; border-color: var(--line-3); background: radial-gradient(ellipse at 50% 0%, rgba(var(--gold-rgb), .2), transparent 70%), linear-gradient(180deg, #2a2117, #18130d); box-shadow: var(--frame), 0 0 18px rgba(var(--gold-rgb), .12); }
.tile.big .l { color: var(--gold-2); letter-spacing: .14em; }
.tile.big .v { font-family: var(--f-display); font-size: 32px; color: var(--gold); text-shadow: 0 1px 0 #000, 0 0 18px rgba(var(--gold-rgb), .35); }
.d { font-size: 11.5px; margin-left: 6px; font-weight: 700; font-family: var(--f-body); text-shadow: none; }
.tile.big .d { font-size: 14px; }
.d.up { color: var(--up); }
.d.down { color: var(--down); }
.sec { margin-bottom: 6px; border: 1px solid var(--line); border-radius: 7px; overflow: hidden; background: rgba(0, 0, 0, .18); }
.sec summary { cursor: pointer; padding: 8px 11px; background: linear-gradient(180deg, #251e16, #1b1610); font-family: var(--f-display); font-weight: 700; font-size: 14px; color: var(--gold); list-style: none; display: flex; justify-content: space-between; align-items: center; }
.sec summary:hover { color: var(--gold-hi); }
.sec summary::-webkit-details-marker { display: none; }
.sec summary::after { content: '▸'; color: var(--gold-3); font-size: 12px; }
.sec[open] summary::after { content: '▾'; }
.sec summary .d { font-family: var(--f-body); }
.st { display: grid; grid-template-columns: 1fr auto; gap: 8px; padding: 4px 11px; border-top: 1px solid rgba(var(--line-rgb), .07); font-size: 12.5px; }
.st:nth-child(odd) { background: rgba(255, 230, 180, .015); }
.st:hover { background: var(--soft); }
.st .nm { color: var(--muted); cursor: default; }
.st .vl { text-align: right; white-space: nowrap; font-weight: 600; }
.st .vl small { color: var(--dim); font-size: 11px; margin-left: 5px; font-weight: 400; }
.st.changed .nm { color: var(--fg); }
.note { color: var(--dim); font-size: 11px; margin-top: 12px; line-height: 1.45; text-align: center; }
.baseline { font-size: 11.5px; color: var(--gold-2); margin: -4px 0 8px; font-style: italic; }

/* ---------- tooltip ---------- */
.tip { position: fixed; z-index: 100; max-width: 390px; background: linear-gradient(180deg, #1f1912, #120f0b); border: 1px solid var(--line-3); border-radius: 7px; padding: 10px 12px; font-size: 12.5px; line-height: 1.5; pointer-events: none; box-shadow: 0 12px 30px rgba(0, 0, 0, .65), var(--frame); white-space: pre-line; }
.tip b { font-family: var(--f-display); font-size: 15px; color: var(--gold); }
.tip .g { color: var(--bonus); }
.tip .m { color: var(--muted); }

.code-area { width: 100%; height: 110px; resize: vertical; padding: 9px; background: rgba(0, 0, 0, .35); border: 1px solid var(--line); border-radius: 6px; font-family: Consolas, monospace; font-size: 11.5px; color: var(--fg); outline: none; word-break: break-all; }
.toast { position: fixed; bottom: 22px; left: 50%; transform: translateX(-50%); background: linear-gradient(180deg, var(--p1), var(--gold-2)); color: var(--on-gold); padding: 8px 18px; border-radius: 7px; font-weight: 700; z-index: 120; box-shadow: 0 8px 24px rgba(0, 0, 0, .6); border: 1px solid #fff0c4; }

/* ---------- motion: press, choose, appear ---------- */
.gslot, .slot, .li, .pop-opt, .talent, .opt, .upg button, .colors button, .btn, .stat-row button, .seg button, .lang button, .pickbtn, .model, .tab, .tile {
  transition: transform .09s ease, border-color .12s, box-shadow .15s, background .12s, color .12s, filter .12s;
}
:is(.gslot, .slot, .li, .pop-opt, .talent, .upg button, .colors button, .btn, .stat-row button, .seg button, .lang button, .pickbtn, .tab):not(.locked):not(:disabled):active { transform: scale(.94); filter: brightness(1.15); }
.model:active { transform: scale(.985); }
.opt:active { transform: scale(.985); }
.gslot:not(.locked):hover { transform: translateY(-1px); }
.gslot:not(.locked):active { transform: scale(.92); }
.just { animation: chosen .7s ease-out; }
@keyframes chosen {
  0% { box-shadow: 0 0 0 0 rgba(255, 215, 130, .85), inset 0 0 18px rgba(255, 215, 130, .55); transform: scale(1.06); }
  35% { transform: scale(.98); }
  100% { box-shadow: 0 0 0 16px rgba(255, 215, 130, 0), inset 0 0 0 rgba(255, 215, 130, 0); transform: scale(1); }
}
.gslot.just .gs-img { animation: glint .7s ease-out; }
@keyframes glint { 0% { filter: brightness(2.2) drop-shadow(0 0 8px #ffd98a); } 100% { filter: none; } }
.modal:not([hidden]) { animation: fade-in .16s ease-out; }
.dialog { animation: dlg-in .2s cubic-bezier(.2, .9, .3, 1.2); }
.pop, .menu:not([hidden]) { animation: pop-in .15s ease-out; transform-origin: top center; }
.tab-body.enter > * { animation: fade-in .2s ease-out; }
.toast { animation: toast-in .25s ease-out; }
@keyframes fade-in { from { opacity: 0; } }
@keyframes dlg-in { from { opacity: 0; transform: scale(.94) translateY(8px); } }
@keyframes pop-in { from { opacity: 0; transform: translateY(-6px) scale(.98); } }
@keyframes toast-in { from { opacity: 0; transform: translate(-50%, 10px); } }

/* ---------- stat sheet (parchment, like the in-game character window) ---------- */
.sheet { border-radius: 9px; padding: 3px; background: linear-gradient(180deg, #8a6633, #4a3418); box-shadow: 0 0 0 1px #000, 0 8px 22px rgba(0, 0, 0, .55), inset 0 1px 0 rgba(255, 220, 150, .35); }
.sheet-tabs { display: flex; gap: 4px; padding: 5px 6px 0; }
.stab { flex: 1; padding: 6px 8px 5px; border: 1px solid #1a120a; border-bottom: 0; border-radius: 7px 7px 0 0; cursor: pointer; font-size: 13px;
  background: linear-gradient(180deg, #3a2e20, #241b12); color: #d9c49a; box-shadow: inset 0 1px 0 rgba(255, 220, 150, .15); }
.stab:hover { color: #fff1cf; }
.stab.on { background: linear-gradient(180deg, #f3e6c6, #e6d3aa); color: #3a2914; border-color: #8a6a3a; font-weight: 600; position: relative; top: 1px; }
.sheet-body {
  color: #3a2914; padding: 8px 8px 10px; border-radius: 0 0 7px 7px; border: 1px solid #8a6a3a;
  background:
    radial-gradient(ellipse at 20% 10%, rgba(255, 255, 255, .35), transparent 50%),
    radial-gradient(ellipse at 80% 90%, rgba(150, 110, 50, .18), transparent 55%),
    linear-gradient(180deg, #efe1bf, #ddc89d);
  box-shadow: inset 0 0 18px rgba(120, 80, 30, .35);
}
.srow { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; padding: 2px 8px; margin-bottom: 2px; font-size: 13.5px;
  background: linear-gradient(90deg, rgba(255, 250, 235, .55), rgba(255, 250, 235, .2)); border: 1px solid rgba(140, 105, 55, .28); border-radius: 2px; cursor: default; }
.srow:hover { background: rgba(255, 250, 235, .8); border-color: rgba(140, 105, 55, .55); }
.srow .sn { color: #3a2914; }
.srow .sv { font-weight: 600; white-space: nowrap; font-variant-numeric: tabular-nums; text-align: right; }
.srow .sv small { font-size: 10.5px; font-weight: 400; color: #7a5a30; margin-left: 6px; }
.srow.strong .sn, .srow.strong .sv { font-weight: 700; color: #6b3c06; }
.shead { color: #7b5c34; margin: 9px 2px 3px; font-size: 13.5px; border-bottom: 1px solid rgba(140, 105, 55, .35); padding-bottom: 1px; }
.sheet .d { font-size: 11px; margin-left: 5px; }
.sheet .d.up { color: #2c7a12; }
.sheet .d.down { color: #a32b16; }
.mastery { display: grid; grid-template-columns: 1fr 1fr; gap: 5px 8px; margin: 6px 0 2px; padding: 6px; background: rgba(120, 85, 40, .12); border: 1px solid rgba(140, 105, 55, .3); border-radius: 3px; }
.mst { display: flex; align-items: center; gap: 6px; min-width: 0; cursor: default; }
.mst img, .mst .ph { width: 26px; height: 26px; border-radius: 3px; border: 1px solid #8a6a3a; flex: none; }
.mst-main { flex: 1; min-width: 0; }
.mst-name { font-size: 12.5px; color: #3a2914; line-height: 1.1; margin-bottom: 2px; }
.bar { position: relative; height: 9px; background: #3b2d1b; border: 1px solid #6b4a22; border-radius: 2px; box-shadow: inset 0 1px 2px rgba(0, 0, 0, .6); }
.bar i { position: absolute; left: 0; top: 0; bottom: 0; background: linear-gradient(180deg, #b6e86a, #5e9c22); border-radius: 1px; box-shadow: 0 0 4px rgba(150, 220, 80, .6); transition: width .25s ease; }
.bar .lvl { position: absolute; left: -4px; top: -6px; z-index: 1; min-width: 16px; height: 16px; padding: 0 3px; border-radius: 3px; background: linear-gradient(180deg, #6fbf2c, #33701a); border: 1px solid #1f3f0c; color: #fff; font-size: 11px; font-weight: 800; line-height: 14px; text-align: center; text-shadow: 0 1px 0 #000; }
.sheet-foot { display: flex; justify-content: flex-end; gap: 4px; margin-top: 8px; font-size: 12.5px; color: #5a4325; }
.sheet-foot b { color: #3a2914; }
.sheet-foot b.neg { color: #a32b16; }
.ssec { margin-bottom: 6px; }
.ssec summary { cursor: pointer; list-style: none; display: flex; align-items: center; gap: 6px; color: #6b4a22; font-weight: 700; font-size: 13.5px; padding: 3px 2px; border-bottom: 1px solid rgba(140, 105, 55, .35); margin-bottom: 3px; }
.ssec summary::-webkit-details-marker { display: none; }
.ssec summary::before { content: '▸'; font-size: 11px; }
.ssec[open] summary::before { content: '▾'; }
.ssec summary .cnt { margin-left: auto; background: #6b4a22; color: #f3e6c6; font-size: 10.5px; border-radius: 7px; padding: 0 6px; }
.srow { transition: background .12s, border-color .12s; }

/* + / − on mastery bars */
.mst-btns { display: flex; flex-direction: column; gap: 2px; flex: none; }
.mst-btns button { width: 18px; height: 13px; padding: 0; border-radius: 3px; cursor: pointer; font-size: 12px; font-weight: 900; line-height: 11px;
  border: 1px solid #1f3f0c; color: #fff; text-shadow: 0 1px 0 #000; transition: transform .08s, filter .1s; }
.mst-plus { background: linear-gradient(180deg, #8fd84a, #3f8a1a); box-shadow: 0 0 6px rgba(140, 220, 70, .55); }
.mst-minus { background: linear-gradient(180deg, #b58a55, #6b4a22); border-color: #3d2a12 !important; height: 11px !important; font-size: 11px !important; line-height: 9px !important; }
.mst-btns button:hover:not(:disabled) { filter: brightness(1.2); }
.mst-btns button:active:not(:disabled) { transform: scale(.85); }
.mst-btns button:disabled { opacity: .25; cursor: default; box-shadow: none; filter: grayscale(1); }
.mst.just .bar i { animation: barflash .6s ease-out; }
@keyframes barflash { 0% { filter: brightness(2) drop-shadow(0 0 6px #d6ff9a); } 100% { filter: none; } }
/* card/stamp effect toggles */
.procs { margin-top: 4px; }
.check.proc { align-items: flex-start; font-size: 12px; color: var(--muted); margin: 4px 0 2px 2px; }
.check.proc input { margin-top: 1px; }
.check.proc b { color: var(--fg); font-weight: 600; }
.check.proc.on, .check.proc.on b { color: var(--bonus); }

/* proc toggle: a folded corner in the top-right of the slot (white when the effect is on) */
.gs-proc { position: absolute; right: 0; top: 0; z-index: 2; width: calc(var(--s) * .34); height: calc(var(--s) * .34); cursor: pointer; }
.gs-proc input { position: absolute; opacity: 0; width: 0; height: 0; }
.gs-proc .box { display: block; width: 100%; height: 100%; border-radius: 0 5px 0 0; clip-path: polygon(0 0, 100% 0, 100% 100%);
  background: linear-gradient(225deg, rgba(255, 255, 255, .38), rgba(255, 255, 255, .14)); transition: background .15s, transform .08s; transform-origin: top right; }
.gs-proc:hover .box { background: linear-gradient(225deg, rgba(255, 255, 255, .7), rgba(255, 255, 255, .35)); }
.gs-proc:active .box { transform: scale(.85); }
.gs-proc.on .box { background: linear-gradient(225deg, #ffffff, #dcdcdc); box-shadow: none; }
.gs-proc.on .box::after { content: '✓'; position: absolute; right: 2px; top: 0; color: #2f7a12; font-size: calc(var(--s) * .17); font-weight: 900; line-height: 1.1; }

/* in-game style item tooltip */
.tip:has(.tt-item) { white-space: normal; padding: 9px 12px 10px; min-width: 250px; max-width: 360px; background: rgba(10, 9, 7, .96); }
.tt-item { font-size: 12.5px; line-height: 1.42; color: #e8e2d4; }
.tt-title { font-family: var(--f-display); font-size: 15px; font-weight: 700; color: #f2ecdf; display: flex; align-items: center; gap: 2px; flex-wrap: wrap; text-shadow: 0 1px 0 #000; }
.tt-ic { width: 15px; height: 15px; vertical-align: -2px; margin-right: 2px; }
.tt-red { color: #e0524a; font-size: 12px; }
.tt-sub { display: flex; justify-content: space-between; gap: 12px; color: var(--muted); font-size: 12px; }
.tt-sec { margin-top: 6px; padding-top: 5px; border-top: 1px solid rgba(var(--line-rgb), .12); }
.tt-up { color: #f3d36b; font-weight: 600; }
.tt-card { color: #5fd3b0; font-weight: 600; display: flex; align-items: center; gap: 3px; }
.tt-li::before { content: '◊ '; color: var(--muted); }
.tt-req { margin-top: 7px; padding-top: 5px; border-top: 1px solid rgba(var(--line-rgb), .12); color: #cbbf9f; font-size: 12px; }
.tt-req-row { display: flex; justify-content: space-between; gap: 14px; }
.tt-req .bad { color: #e0524a; }
.tt-slot { display: flex; align-items: center; gap: 6px; color: #cbbf9f; }
.tt-empty-card { width: 11px; height: 15px; border: 1px solid #8a7a5c; border-radius: 2px; background: linear-gradient(180deg, #2b261e, #17140f); box-shadow: inset 0 0 0 2px #1a1610; }
/* slot frame tinted by the stamp color */
.gslot.stamped { border-color: var(--sc); box-shadow: inset 0 0 0 1px #000, inset 0 0 14px rgba(0, 0, 0, .9), 0 0 8px color-mix(in srgb, var(--sc) 45%, transparent); }

/* ---------- talent window (like the in-game one) ---------- */
.talwin { display: flex; flex-direction: column; gap: 14px; padding: 18px 20px 14px; border: 1px solid var(--line-3); border-radius: 10px;
  background: radial-gradient(ellipse at 50% 0%, rgba(var(--gold-rgb), .06), transparent 60%), linear-gradient(180deg, #24201a, #17140f); box-shadow: var(--frame), 0 6px 20px rgba(0, 0, 0, .45); }
.tal-branch { display: grid; grid-template-columns: 150px 1fr; align-items: center; gap: 12px; padding-bottom: 14px; border-bottom: 1px solid rgba(var(--line-rgb), .1); }
.tal-branch:last-of-type { border-bottom: 0; padding-bottom: 0; }
.tal-name { display: flex; align-items: center; gap: 8px; padding-left: 10px; border-left: 3px solid var(--bc); font-family: var(--f-display); font-size: 16px; font-weight: 700; color: var(--fg); }
.tal-name b { font-family: var(--f-body); font-size: 11px; background: var(--gold-3); color: var(--on-gold); border-radius: 8px; padding: 0 7px; }
.tal-cols { display: flex; align-items: center; gap: 8px; }
.tal-col { display: flex; flex-direction: column; gap: 8px; }
.tal-col.single { margin: 0 10px; }
.tal { --t: 50px; width: var(--t); height: var(--t); border-radius: 50%; cursor: pointer; position: relative; background: #000;
  border: 2px solid #3a3227; box-shadow: 0 2px 5px rgba(0, 0, 0, .7), inset 0 0 0 1px #000; overflow: hidden; transition: transform .09s, box-shadow .15s, border-color .15s, filter .15s; }
.tal.active { border-radius: 4px; }
.tal img { width: 100%; height: 100%; display: block; filter: grayscale(1) brightness(.62) contrast(1.1); transition: filter .15s; }
.tal.can:hover img { filter: grayscale(.2) brightness(.95); }
.tal.can:hover { border-color: var(--gold-2); box-shadow: 0 0 10px rgba(var(--gold-rgb), .4); }
.tal.locked { cursor: default; }
.tal.locked img { filter: grayscale(1) brightness(.42); }
.tal.on { border-color: var(--gold); box-shadow: 0 0 0 1px #000, 0 0 12px rgba(var(--gold-rgb), .6); }
.tal.on img { filter: none; }
.tal.can:not(.on):active, .tal.on:active { transform: scale(.92); }
.tal-foot { display: flex; align-items: center; gap: 16px; padding-top: 6px; }
.tal-free { color: #7fd36a; font-size: 14px; font-weight: 600; flex: 1; }
.tal-free.neg { color: var(--bad); }

/* event hints under the event selector */
.ev-hints { margin: -2px 0 8px 104px; display: flex; flex-direction: column; gap: 3px; }
.ev-hint { font-size: 11.5px; color: var(--muted); cursor: pointer; line-height: 1.3; padding: 2px 6px; border-radius: 5px; border: 1px dashed var(--line); }
.ev-hint:hover { border-color: var(--line-3); color: var(--fg); }
.ev-hint b { font-weight: 600; color: var(--fg); }
.ev-hint.on { border-style: solid; border-color: rgba(134, 212, 109, .45); color: var(--up); }
.tt-off { color: #7c7466; text-decoration: line-through; text-decoration-color: rgba(124, 116, 102, .6); }
.pop-ic { width: 32px; height: 32px; border-radius: 5px; border: 1px solid #4a3920; flex: none; background: #0e0c09; }
.ev-hint.on:hover { border-color: rgba(134, 212, 109, .8); color: #a6ef8c; }
.ev-none { font-size: 11.5px; color: var(--dim); font-style: italic; padding: 2px 6px; }

/* location background behind the character */
.model-bg { position: absolute; inset: -8px; z-index: 0; background-repeat: no-repeat; filter: blur(1.6px) brightness(.62) saturate(.9) contrast(1.05); transform: scale(1.03); }
.model-shade { position: absolute; inset: 0; z-index: 0; pointer-events: none;
  background:
    radial-gradient(ellipse 60% 48% at 50% 52%, rgba(255, 210, 140, .10), transparent 70%),
    radial-gradient(ellipse 85% 75% at 50% 50%, transparent 45%, rgba(5, 4, 2, .75) 100%),
    linear-gradient(180deg, rgba(8, 6, 4, .78) 0%, transparent 22%, transparent 70%, rgba(8, 6, 4, .55) 100%); }
.model-fig { z-index: 1; }
.model-cap { z-index: 2; }
.bg-pick { position: absolute; left: 8px; bottom: 8px; z-index: 3; display: flex; gap: 5px; opacity: .55; transition: opacity .15s; }
.model:hover .bg-pick { opacity: 1; }
.bg-pick button { width: 18px; height: 18px; border-radius: 50%; padding: 0; cursor: pointer; background-size: auto 400%; border: 1px solid rgba(var(--gold-rgb), .45); box-shadow: 0 1px 3px #000; transition: transform .1s, border-color .12s; }
.bg-pick button:hover { transform: scale(1.2); border-color: var(--gold); }
.bg-pick button.on { border: 2px solid var(--gold-hi); box-shadow: 0 0 6px rgba(255, 226, 160, .6); }

/* ---------- public builds ---------- */
.pb-bar { display: flex; align-items: center; gap: 8px; margin-bottom: 14px; flex-wrap: wrap; }
.pb-bar .inp { flex: 1; min-width: 110px; }
.pb-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 10px; align-items: start; }
.pb-msg { grid-column: 1 / -1; text-align: center; padding: 30px 0; font-size: 13px; }
.pb-card { background: linear-gradient(180deg, #211b14, #17130e); border: 1px solid var(--line-2); border-radius: 9px; padding: 11px 12px; box-shadow: var(--frame), 0 3px 10px rgba(0, 0, 0, .35); transition: border-color .12s, box-shadow .15s; }
.pb-card:hover { border-color: var(--line-3); box-shadow: var(--frame), 0 0 14px rgba(var(--gold-rgb), .14); }
.pb-card.mine { border-color: rgba(134, 212, 109, .4); }
.pb-head { display: flex; align-items: center; gap: 10px; }
.pb-head img, .pb-head .ph { width: 40px; height: 40px; border-radius: 7px; border: 1px solid var(--line-3); background: radial-gradient(circle, #3a2d1a, #120f0b); flex: none; }
.pb-title { flex: 1; min-width: 0; }
.pb-name { font-family: var(--f-display); font-size: 16px; font-weight: 700; color: var(--gold); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pb-meta { font-size: 11.5px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pb-mine { font-size: 10.5px; font-weight: 700; color: var(--up); border: 1px solid rgba(134, 212, 109, .45); border-radius: 8px; padding: 0 7px; }
.pb-stats { display: flex; gap: 6px; margin: 9px 0 6px; }
.pb-stats div { flex: 1; background: rgba(0, 0, 0, .3); border: 1px solid var(--line); border-radius: 6px; padding: 4px 8px; }
.pb-stats span { display: block; font-size: 10px; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); font-weight: 700; }
.pb-stats b { font-size: 15px; font-variant-numeric: tabular-nums; }
.pb-desc { font-size: 12.5px; color: var(--muted); line-height: 1.4; margin-bottom: 6px; white-space: pre-line; max-height: 5.6em; overflow: hidden; }
.pb-foot { display: flex; align-items: center; gap: 6px; margin-top: 4px; }
.pb-like { background: rgba(0, 0, 0, .3); border: 1px solid var(--line-2); border-radius: 12px; padding: 2px 10px; cursor: pointer; color: #e98a8a; font-weight: 700; font-size: 12.5px; transition: transform .08s, border-color .12s; }
.pb-like:hover:not(:disabled) { border-color: #e98a8a; }
.pb-like:active:not(:disabled) { transform: scale(.9); }
.pb-like.on { background: rgba(233, 138, 138, .15); border-color: rgba(233, 138, 138, .6); cursor: default; }
.pb-sum { display: flex; align-items: center; gap: 10px; margin-bottom: 12px; }
.pb-sum img { width: 40px; height: 40px; border-radius: 7px; border: 1px solid var(--line-3); }
.pb-setup { max-width: 640px; }
.btn.public { margin-left: 6px; border-color: rgba(143, 201, 214, .45); color: #bfe3ec; }
.btn.public:hover { border-color: #8fc9d6; box-shadow: 0 0 10px rgba(143, 201, 214, .25); }
.btn.public.on { background: linear-gradient(180deg, #2d4650, #1c2c33); border-color: #8fc9d6; color: #e6f7fb; }
.seg button { white-space: nowrap; }

/* styled confirmation */
.confirm-wrap { z-index: 90; }
.dialog.confirm { width: min(420px, calc(100vw - 40px)); height: auto; padding: 22px 22px 16px; align-items: center; text-align: center; animation: dlg-in .18s cubic-bezier(.2, .9, .3, 1.2); }
.confirm-icon { width: 46px; height: 46px; border-radius: 50%; display: flex; align-items: center; justify-content: center; font-size: 22px; font-weight: 800; margin-bottom: 12px;
  color: var(--gold); border: 2px solid var(--gold-2); background: radial-gradient(circle, rgba(var(--gold-rgb), .18), transparent 70%); }
.confirm-icon.danger { color: #ff8a7e; border-color: rgba(236, 107, 94, .75); background: radial-gradient(circle, rgba(236, 107, 94, .2), transparent 70%); }
.confirm-text { font-size: 14.5px; line-height: 1.5; color: var(--fg); margin-bottom: 18px; }
.confirm-foot { display: flex; gap: 8px; justify-content: center; width: 100%; }
.confirm-foot .btn { min-width: 120px; }
.btn.danger-solid { background: linear-gradient(180deg, #d9584c, #a5352b); color: #fff; border-color: #f08a7f; }
.btn.danger-solid:hover { filter: brightness(1.08); box-shadow: 0 0 12px rgba(236, 107, 94, .4); }

.sheet-foot { align-items: center; }
.sheet-reset { background: none; border: 1px solid rgba(140, 105, 55, .5); border-radius: 4px; padding: 1px 8px; font-size: 11.5px; color: #6b4a22; cursor: pointer; }
.sheet-reset:hover { background: rgba(255, 250, 235, .6); border-color: #8a6a3a; }
.note.contact { margin-top: 4px; cursor: pointer; }
.note.contact .discord { color: #a7b1ff; }
.note.contact .discord b { color: #c9cfff; }
.note.contact:hover .discord b { text-decoration: underline; }

/* update banner */
.upd { position: fixed; right: 18px; bottom: 18px; z-index: 110; width: 300px; padding: 12px 14px; border-radius: 9px;
  background: linear-gradient(180deg, #221c14, #17130e); border: 1px solid var(--line-3); box-shadow: 0 12px 30px rgba(0, 0, 0, .6), var(--frame); animation: pop-in .2s ease-out; }
/* "the calculator is now on the web": bottom left, so it never covers the update banner */
.upd.site { right: auto; left: 18px; width: 320px; }
.upd.site a.btn { text-decoration: none; display: inline-flex; align-items: center; }
.note .site-link { color: var(--gold); text-decoration: none; }
.note .site-link:hover { text-decoration: underline; }
.upd-t { font-family: var(--f-display); font-weight: 700; color: var(--gold); margin-bottom: 6px; }
.upd-s { font-size: 12px; color: var(--muted); margin-bottom: 9px; }
.upd-bar { height: 6px; border-radius: 3px; background: rgba(0, 0, 0, .5); overflow: hidden; }
.upd-bar i { display: block; height: 100%; background: linear-gradient(90deg, var(--gold-2), var(--gold-hi)); transition: width .3s; }

/* class picker */
.cls-btn { width: 100%; display: flex; align-items: center; gap: 8px; padding: 4px 9px 4px 4px; background: rgba(0, 0, 0, .35); border: 1px solid var(--line); border-radius: 6px; cursor: pointer; text-align: left; box-shadow: inset 0 1px 3px rgba(0, 0, 0, .5); }
.cls-btn:hover { border-color: var(--line-3); }
.cls-btn img { width: 26px; height: 26px; border-radius: 5px; border: 1px solid var(--line-2); }
.cls-btn span:nth-of-type(1) { flex: 1; font-weight: 600; }
.pop.cp { padding: 12px; width: auto; }
.cp-grid { display: grid; grid-template-columns: repeat(4, 200px); gap: 10px; }
.cp-col { display: flex; flex-direction: column; gap: 6px; padding: 8px; border: 1px solid var(--line); border-radius: 8px; background: rgba(0, 0, 0, .2); }
.cp-subs { display: flex; flex-direction: column; gap: 4px; padding-left: 12px; border-left: 1px solid var(--line-2); margin-left: 18px; }
.cp-item { display: flex; align-items: center; gap: 9px; padding: 5px 7px; border-radius: 7px; cursor: pointer; border: 1px solid transparent; transition: background .12s, border-color .12s, transform .08s; }
.cp-item:hover { background: var(--soft); border-color: var(--line-2); }
.cp-item:active { transform: scale(.96); }
.cp-item img { width: 40px; height: 40px; border-radius: 7px; border: 1px solid var(--line-3); background: radial-gradient(circle, #3a2d1a, #120f0b); flex: none; }
.cp-item.sub img { width: 32px; height: 32px; }
.cp-name { font-family: var(--f-display); font-weight: 700; font-size: 15px; color: var(--gold); }
.cp-item.sub .cp-name { font-size: 13.5px; color: var(--fg); }
.cp-lv { font-size: 11px; color: var(--dim); }
.cp-item.on { background: linear-gradient(90deg, rgba(var(--gold-rgb), .2), rgba(var(--gold-rgb), .05)); border-color: var(--line-3); }
.cp-item.on .cp-name { color: var(--gold-hi); }

/* party auras */
.party-h { margin-top: 18px; }
.party-h + .hint { margin: -2px 0 6px; }
.opt .cls-of { font-weight: 400; color: var(--dim); font-size: 11.5px; }
.tal-chip { font: inherit; font-size: 10.5px; font-weight: 700; padding: 3px 7px; border-radius: 10px; cursor: pointer; white-space: nowrap;
  color: var(--dim); background: transparent; border: 1px solid #4a3920; transition: background .15s, color .15s, border-color .15s; }
.tal-chip:hover { color: var(--fg); border-color: var(--line-3); }
.tal-chip.on { color: var(--on-gold); background: linear-gradient(180deg, var(--gold-hi), var(--gold-2)); border-color: var(--gold-hi); }

/* guild talents */
.guildwin { margin-top: 16px; }
.gw-title { font-family: var(--f-display); font-size: 17px; font-weight: 700; color: var(--gold); letter-spacing: .02em; }
.gt-branch { grid-template-columns: 150px auto 1fr; }
.gt-branch .tal-cols { gap: 12px; }
.gt-locked .tal-name { opacity: .5; }
.tal .gt-pts { position: absolute; right: -4px; bottom: -4px; min-width: 18px; height: 18px; padding: 0 4px; border-radius: 9px; font-size: 11px; font-weight: 800;
  line-height: 18px; text-align: center; color: var(--on-gold); background: var(--gold-2); border: 1px solid #000; }
.tal:has(.gt-pts) { overflow: visible; }
.gt-step { justify-self: end; display: flex; align-items: center; gap: 6px; }
.gt-step span { min-width: 34px; text-align: center; font-weight: 700; font-size: 13px; color: var(--fg); font-variant-numeric: tabular-nums; }
.gt-step.off span { color: var(--dim); }
.gt-step button { width: 24px; height: 24px; border-radius: 5px; border: 1px solid var(--line-3); background: var(--raise); color: var(--gold); font: inherit; font-weight: 800; cursor: pointer; line-height: 1; }
.gt-step button:hover:not(:disabled) { background: var(--raise-2); border-color: var(--gold-2); }
.gt-step button:active:not(:disabled) { transform: scale(.9); }
.gt-step button:disabled { opacity: .35; cursor: default; }
.tal:has(.gt-pts) img { border-radius: inherit; }

/* public build whose data is impossible in the game */
.pb-bad { font-size: 10.5px; font-weight: 700; color: var(--bad); border: 1px solid currentColor; border-radius: 8px; padding: 0 7px; cursor: help; white-space: nowrap; }
.pb-card.bad { border-color: rgba(224, 96, 80, .45); }
.pb-card.bad .pb-stats b { color: var(--muted); }
.upd-btns { display: flex; justify-content: flex-end; gap: 8px; }

/* TEST client (started from the source code) */
.test-badge { margin-left: 10px; padding: 2px 8px; border-radius: 6px; font: 800 11px var(--f-body); letter-spacing: .12em; vertical-align: middle;
  color: #fff; background: linear-gradient(180deg, #d9534a, #a8322b); box-shadow: 0 0 10px rgba(217, 83, 74, .5); cursor: help; }

/* top bar buttons with line icons */
#btnSave, #btnBuilds, #btnNew, #btnCode, #btnPublic { display: inline-flex; align-items: center; gap: 7px; }
.btn .ic { width: 15px; height: 15px; flex: none; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; opacity: .9; }
.btn .ic.caret { width: 12px; height: 12px; margin-left: -2px; opacity: .7; transition: transform .15s; }
#btnBuilds:hover .ic.caret { transform: translateY(1px); }
.tab .ic { width: 16px; height: 16px; margin-right: 8px; vertical-align: -3px; fill: none; stroke: currentColor; stroke-width: 1.9; stroke-linecap: round; stroke-linejoin: round; opacity: .75; transition: opacity .15s; }
.tab:hover .ic, .tab.on .ic { opacity: 1; }
.tab.on .ic { filter: drop-shadow(0 0 4px rgba(var(--gold-rgb), .45)); }

/* "under crowd control" switch card */
.lc { display: grid; grid-template-columns: 26px 1fr 36px; gap: 10px; align-items: center; margin-top: 12px; padding: 9px 10px; cursor: pointer; user-select: none;
  border: 1px solid var(--line); border-radius: 8px; background: rgba(0, 0, 0, .2); transition: border-color .18s, background .18s, box-shadow .18s; }
.lc:hover { border-color: var(--line-2); }
.lc input { position: absolute; opacity: 0; width: 0; height: 0; }
.lc-ic { display: grid; place-items: center; width: 26px; height: 26px; border-radius: 50%; color: var(--dim); background: rgba(255, 255, 255, .03); transition: color .18s; }
.lc-ic .ic { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.lc-text { display: flex; flex-direction: column; line-height: 1.25; }
.lc-text b { font-size: 13px; color: var(--fg); font-weight: 600; }
.lc-text small { font-size: 10.5px; color: var(--dim); margin-top: 2px; }
.lc .sw { position: relative; width: 36px; height: 20px; border-radius: 10px; background: #231d16; border: 1px solid var(--line-2); transition: background .18s, border-color .18s; }
.lc .sw::after { content: ''; position: absolute; top: 2px; left: 2px; width: 14px; height: 14px; border-radius: 50%; background: #7d6e55; transition: transform .18s, background .18s; }
.lc input:focus-visible ~ .sw { outline: 2px solid var(--gold-2); outline-offset: 2px; }
.lc.on { border-color: var(--line-3); background: linear-gradient(90deg, rgba(var(--gold-rgb), .12), rgba(0, 0, 0, .2)); box-shadow: 0 0 12px rgba(var(--gold-rgb), .15); }
.lc.on .lc-ic { color: var(--gold); filter: drop-shadow(0 0 4px rgba(var(--gold-rgb), .5)); }
.lc.on .lc-text small { color: var(--muted); }
.lc.on .sw { background: linear-gradient(180deg, var(--gold-hi), var(--gold-2)); border-color: var(--gold-hi); }
.lc.on .sw::after { transform: translateX(16px); background: #1a1206; }
.lc:active .sw::after { width: 17px; }

/* class filter of public builds */
.pb-cls { display: inline-flex; align-items: center; gap: 7px; }
.pb-cls img { width: 20px; height: 20px; border-radius: 4px; border: 1px solid var(--line-3); }
.pb-cls .ic { width: 15px; height: 15px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.pb-cls .ic:last-child { width: 12px; height: 12px; opacity: .7; }
.pb-cls.on { color: var(--gold); border-color: var(--line-3); }
.cp-all { margin-bottom: 10px; padding: 8px 10px; border: 1px solid var(--line); background: rgba(0, 0, 0, .2); }
.cp-all-ic { display: grid; place-items: center; width: 32px; height: 32px; border-radius: 7px; border: 1px solid var(--line-3); color: var(--gold); background: radial-gradient(circle, #3a2d1a, #120f0b); }
.cp-all-ic .ic { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }

/* tags on public builds */
.tag { font: inherit; font-size: 11px; font-weight: 600; padding: 2px 9px; border-radius: 10px; cursor: pointer; white-space: nowrap;
  color: var(--muted); background: rgba(0, 0, 0, .25); border: 1px solid var(--line-2); transition: color .12s, background .12s, border-color .12s, transform .08s; }
.tag:hover:not(:disabled) { color: var(--fg); border-color: var(--line-3); }
.tag:active:not(:disabled) { transform: scale(.94); }
.tag.on { color: var(--on-gold); background: linear-gradient(180deg, var(--gold-hi), var(--gold-2)); border-color: var(--gold-hi); }
.tag.off { opacity: .35; cursor: default; }
.pb-tags { display: flex; flex-wrap: wrap; gap: 5px; margin-top: 8px; }
.pb-tagpick { display: flex; flex-wrap: wrap; gap: 6px; }
.pb-tagpick .tag { font-size: 12px; padding: 4px 11px; }
.field label small { font-weight: 400; color: var(--dim); }
.pb-tagfilter { grid-column: 1 / -1; display: flex; align-items: center; gap: 8px; font-size: 12.5px; color: var(--muted); }
.tag.edit { border-style: dashed; color: var(--gold); background: transparent; }
.tag.edit:hover { background: rgba(var(--gold-rgb), .1); }
.pop.tp { width: 330px; padding: 12px; display: flex; flex-direction: column; align-items: flex-start; gap: 10px; }
.tp-list { display: flex; flex-wrap: wrap; gap: 6px; }
.pop.tp .tag { font-size: 12px; padding: 4px 11px; }
.pop.tp .tag small { opacity: .7; font-weight: 700; }
.pop.tp .tag.empty { opacity: .45; }

/* ---------- boss timer ---------- */
.btn.bosses { border-color: rgba(236, 107, 94, .45); color: #f3c0b8; }
.btn.bosses:hover { border-color: #ec6b5e; box-shadow: 0 0 10px rgba(236, 107, 94, .25); }
.btn.bosses.on { background: linear-gradient(180deg, #4d2620, #2e1714); border-color: #ec6b5e; color: #ffe9e5; }
.bt-room { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-bottom: 10px; padding: 8px 10px; border: 1px solid var(--line); border-radius: 8px; background: rgba(0, 0, 0, .25); }
.bt-room.on { border-color: rgba(134, 212, 109, .45); background: linear-gradient(180deg, rgba(134, 212, 109, .08), rgba(0, 0, 0, .25)); }
.bt-room-l { display: inline-flex; align-items: center; gap: 6px; color: var(--muted); font-size: 12.5px; font-weight: 600; }
.bt-room-l .ic { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.bt-room.on .bt-room-l { color: var(--up); }
.bt-code { font: 700 15px/1 ui-monospace, Consolas, monospace; letter-spacing: .14em; color: var(--gold-hi); background: rgba(0, 0, 0, .4); border: 1px dashed var(--line-3); border-radius: 6px; padding: 5px 9px; cursor: pointer; }
.bt-code:hover { border-style: solid; border-color: var(--gold); }
.bt-copy { margin-left: 6px; font-size: 12px; opacity: .6; letter-spacing: 0; }
.bt-nick { width: 140px; flex: none; }
.bt-bell { font-size: 15px; padding: 3px 10px; opacity: .6; }
.bt-bell.on { opacity: 1; border-color: var(--line-3); }
.bt-list { display: flex; flex-direction: column; gap: 6px; }
.bt-row { position: relative; display: grid; grid-template-columns: 52px minmax(0, 1fr) minmax(130px, auto) auto; align-items: center; gap: 12px; padding: 8px 12px 10px 8px;
  background: linear-gradient(180deg, #211b14, #17130e); border: 1px solid var(--line-2); border-radius: 9px; box-shadow: var(--frame); overflow: hidden; }
.bt-row:hover { border-color: var(--line-3); }
.bt-pic { width: 52px; height: 52px; border-radius: 50%; border: 2px solid var(--gold-3); background: radial-gradient(circle, #3a2d1a, #120f0b); overflow: hidden; }
.bt-row.elite .bt-pic { border-color: #6d7f9c; }
.bt-pic img { width: 100%; height: 100%; display: block; }
.bt-row.none .bt-pic img { filter: grayscale(.55) brightness(.8); }
.bt-row.up .bt-pic { border-color: var(--up); box-shadow: 0 0 12px rgba(134, 212, 109, .45); }
.bt-name { display: flex; align-items: center; gap: 4px; font-family: var(--f-display); font-size: 15.5px; font-weight: 700; color: var(--gold); min-width: 0; }
.bt-name span { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.bt-row.elite .bt-name { color: #c6d3e8; }
.bt-star { background: none; border: 0; padding: 0 2px; font-size: 15px; line-height: 1; color: var(--dim); cursor: pointer; }
.bt-star:hover, .bt-star.on { color: var(--gold-hi); }
.bt-meta { font-size: 11.5px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.bt-resp { margin-top: 2px; background: none; border: 0; padding: 0; font-size: 11.5px; color: var(--dim); cursor: pointer; }
.bt-resp:hover { color: var(--gold); text-decoration: underline; }
.bt-resp.custom { color: var(--card); }
.bt-state { text-align: right; }
.bt-big { font-size: 20px; font-weight: 700; font-variant-numeric: tabular-nums; color: var(--fg); line-height: 1.15; }
.bt-sub { font-size: 11.5px; color: var(--muted); white-space: nowrap; }
.bt-row.none .bt-big { font-size: 13px; font-weight: 600; color: var(--dim); }
.bt-row.none .bt-sub { color: var(--dim); opacity: .8; }
.bt-row.up .bt-big { font-size: 15px; color: var(--up); }
.bt-row.wait .bt-big { color: var(--gold-hi); }
.bt-act { display: flex; gap: 5px; }
.bt-kill { white-space: nowrap; }
.bt-prog { position: absolute; left: 0; right: 0; bottom: 0; height: 3px; background: rgba(0, 0, 0, .4); }
.bt-prog i { display: block; height: 100%; background: linear-gradient(90deg, var(--gold-3), var(--gold)); transition: width 1s linear; }
.bt-row.up .bt-prog i { background: var(--up); }
.bt-src { text-align: left; }
.bt-dlg { gap: 12px; }
.bt-dlg h3 { margin: 0; font-family: var(--f-display); color: var(--gold); font-size: 17px; }
.bt-dlg-body { display: flex; flex-direction: column; gap: 10px; width: 100%; align-items: stretch; margin-bottom: 6px; }
.bt-dlg-body .hint { margin: 0; font-size: 12.5px; color: var(--muted); }
.bt-code-inp { text-align: center; font: 700 20px ui-monospace, Consolas, monospace; letter-spacing: .2em; text-transform: uppercase; }
.bt-quick { display: flex; flex-wrap: wrap; gap: 6px; justify-content: center; }
.bt-lbl { display: flex; align-items: center; justify-content: center; gap: 10px; color: var(--muted); font-size: 12.5px; }
.bt-lbl .inp { width: 110px; font-size: 15px; }
.bt-resp-row { display: flex; align-items: center; justify-content: center; gap: 8px; color: var(--muted); }
.bt-resp-row .inp { width: 100px; font-size: 15px; text-align: center; }
@media (max-width: 720px) {
  .bt-row { grid-template-columns: 44px minmax(0, 1fr) auto; }
  .bt-pic { width: 44px; height: 44px; }
  .bt-act { grid-column: 2 / -1; justify-content: flex-end; }
}
/* boss timer tab: no character panels, the list fills the window in two columns */
.layout.wide { grid-template-columns: minmax(0, 1fr); }
.layout.wide > .left, .layout.wide > .right, .layout.wide .tabs { display: none; }
.layout.wide .tab-body { padding: 16px 22px; }
.layout.wide .bt-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(520px, 1fr)); gap: 8px; }
.layout.wide .bt-list .pb-msg { grid-column: 1 / -1; }
.btn:disabled { opacity: .5; cursor: default; }

/* ---------- settings ---------- */
/* accent themes (settings → theme); the dark background stays the same */
:root[data-theme="ice"] { --gold-rgb: 124, 196, 232; --line-rgb: 110, 170, 210; --gold: #7cc4e8; --gold-2: #4f9cc4; --gold-3: #2f6585; --gold-hi: #d4f1ff; --p1: #9ad8f5; --p3: #3a7fa6; --p-border: #bfe9ff; --on-gold: #06141c; }
:root[data-theme="blood"] { --gold-rgb: 232, 122, 106; --line-rgb: 210, 110, 90; --gold: #e87a6a; --gold-2: #c4503f; --gold-3: #85301f; --gold-hi: #ffd0c4; --p1: #f5998a; --p3: #a33a2b; --p-border: #ffc0b4; --on-gold: #1c0705; }
:root[data-theme="emerald"] { --gold-rgb: 116, 211, 154; --line-rgb: 100, 190, 130; --gold: #74d39a; --gold-2: #3fa66a; --gold-3: #23663f; --gold-hi: #c9f7da; --p1: #93e6b4; --p3: #2c8a55; --p-border: #bdf3d2; --on-gold: #04160b; }
:root[data-theme="amethyst"] { --gold-rgb: 185, 156, 240; --line-rgb: 160, 130, 220; --gold: #b99cf0; --gold-2: #8a66d1; --gold-3: #553a8f; --gold-hi: #e7dcff; --p1: #cbb3f7; --p3: #6c4bb3; --p-border: #ddd0ff; --on-gold: #120a22; }
/* settings → animations off */
.no-motion *, .no-motion *::before, .no-motion *::after { animation: none !important; transition: none !important; }

.btn.icon-only { padding: 5px 8px; margin-left: 6px; }
.btn.icon-only .ic { width: 17px; height: 17px; }
.dialog.set-dlg { width: min(640px, calc(100vw - 40px)); height: auto; max-height: calc(100vh - 40px); }
.set-body { overflow: auto; padding: 6px 18px 12px; }
.set-sec { padding: 10px 0 6px; border-bottom: 1px solid var(--line); }
.set-sec:last-child { border-bottom: 0; }
.set-sec h4 { margin: 4px 0 6px; font-family: var(--f-display); font-size: 14px; color: var(--gold); letter-spacing: .03em; }
.set-row { display: flex; align-items: center; gap: 14px; padding: 7px 0; }
.set-l { flex: 1; min-width: 0; }
.set-l b { display: block; font-size: 13px; font-weight: 600; }
.set-l small { display: block; font-size: 11.5px; color: var(--dim); line-height: 1.35; margin-top: 1px; }
.set-c { flex: none; display: flex; justify-content: flex-end; }
.set-inline { display: flex; align-items: center; gap: 8px; }
.set-num { width: 38px; text-align: right; font-variant-numeric: tabular-nums; color: var(--muted); font-size: 12px; }
.set-range { width: 170px; accent-color: var(--gold); }
.set-themes { display: flex; flex-wrap: wrap; gap: 6px; justify-content: flex-end; max-width: 380px; }
.set-theme { display: inline-flex; align-items: center; gap: 6px; padding: 4px 10px 4px 6px; border-radius: 14px; border: 1px solid var(--line-2); background: rgba(0, 0, 0, .3); color: var(--muted); cursor: pointer; font-size: 12px; font-weight: 600; }
.set-theme i { width: 14px; height: 14px; border-radius: 50%; box-shadow: 0 0 0 2px rgba(0, 0, 0, .5); }
.set-theme:hover { color: var(--fg); border-color: var(--line-3); }
.set-theme.on { color: var(--fg); border-color: var(--gold); box-shadow: 0 0 10px rgba(var(--gold-rgb), .3); }
.set-sw { position: relative; display: inline-block; cursor: pointer; }
.set-sw input { position: absolute; opacity: 0; width: 0; height: 0; }
.set-sw span { display: block; position: relative; width: 38px; height: 21px; border-radius: 11px; background: #231d16; border: 1px solid var(--line-2); transition: background .18s, border-color .18s; }
.set-sw span::after { content: ''; position: absolute; top: 2px; left: 2px; width: 15px; height: 15px; border-radius: 50%; background: #7d6e55; transition: transform .18s, background .18s; }
.set-sw input:checked + span { background: linear-gradient(180deg, var(--gold-2), var(--gold-3)); border-color: var(--gold); }
.set-sw input:checked + span::after { transform: translateX(17px); background: var(--gold-hi); }
.set-sw input:focus-visible + span { outline: 2px solid var(--gold-2); outline-offset: 2px; }
.set-foot { display: flex; align-items: center; gap: 8px; padding: 10px 18px; border-top: 1px solid var(--line-2); background: rgba(0, 0, 0, .2); }

/* ---------- tools menu (the brand) ---------- */
button.brand { display: inline-flex; align-items: center; gap: 6px; background: none; border: 1px solid transparent; border-radius: 8px; padding: 4px 8px 4px 6px; margin-left: -6px; cursor: pointer; font: inherit; font-family: var(--f-display); font-weight: 700; font-size: 19px; color: var(--gold); }
button.brand:hover, button.brand.open { border-color: var(--line-2); background: rgba(var(--gold-rgb), .06); }
button.brand .caret { width: 13px; height: 13px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; opacity: .6; transition: transform .15s; }
button.brand.open .caret { transform: rotate(180deg); }
.tools-menu { min-width: 380px; padding: 6px; }
.tool-item { display: flex; align-items: center; gap: 12px; width: 100%; padding: 9px 10px; border: 1px solid transparent; border-radius: 7px; background: none; color: var(--fg); cursor: pointer; text-align: left; }
.tool-item:hover { background: var(--soft); border-color: var(--line); }
.tool-item.on { background: rgba(var(--gold-rgb), .08); border-color: var(--line-2); }
.tool-ic { width: 36px; height: 36px; flex: none; display: flex; align-items: center; justify-content: center; border-radius: 8px; border: 1px solid var(--line-2); background: radial-gradient(circle, #3a2d1a, #120f0b); color: var(--gold); }
.tool-ic .ic { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.tool-txt { flex: 1; min-width: 0; }
.tool-txt b { display: block; font-family: var(--f-display); font-size: 15px; color: var(--gold); }
.tool-txt small { display: block; font-size: 11.5px; color: var(--muted); margin-top: 1px; }
.tool-on { color: var(--gold-hi); font-weight: 700; }
.tool-more { padding: 7px 10px 3px; font-size: 11px; color: var(--dim); text-align: center; }
.tool-name { display: inline-flex; align-items: center; gap: 7px; font-family: var(--f-display); font-size: 16px; font-weight: 700; color: var(--fg); padding-left: 12px; border-left: 1px solid var(--line-2); }
.tool-name .ic { width: 18px; height: 18px; fill: none; stroke: var(--gold); stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
body.tool-timer .calc-only { display: none !important; }
