@import url('https://fonts.googleapis.com/css2?family=Cinzel:wght@500;700;900&family=Alegreya+Sans:wght@400;500;700;800&display=swap');

:root {
  --bg: #0b0a09;
  --bg2: #110f0d;
  --panel: #14110f;
  --panel2: #1b1714;
  --panel3: #241f1a;
  --line: #2f2822;
  --line2: #43392f;
  --text: #e6dcc8;
  --muted: #a39580;
  --dim: #6f6455;
  --gold: #d4a64a;
  --gold2: #f0c868;
  --accent: #c8783a;
  --good: #5fbf6a;
  --bad: #d65050;
  --blue: #5a9be0;
  --purple: #a65fe0;
  --radius: 8px;
  --shadow: 0 10px 30px rgba(0, 0, 0, .45);
  --font: 'Alegreya Sans', 'Segoe UI', system-ui, sans-serif;
  --display: 'Cinzel', Georgia, serif;
}

* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body {
  background: var(--bg);
  color: var(--text);
  font: 15px/1.45 var(--font);
  -webkit-font-smoothing: antialiased;
}
body.is-dragging, body.is-dragging * { cursor: grabbing !important; user-select: none; }
h1, h2, h3, h4 { font-family: var(--display); font-weight: 700; margin: 0; letter-spacing: .02em; }
a { color: var(--gold2); }
button { font: inherit; color: inherit; }
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-thumb { background: #3a332c; border-radius: 6px; border: 2px solid transparent; background-clip: padding-box; }
::-webkit-scrollbar-track { background: transparent; }

/* --- botones y campos --- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  padding: 7px 12px; border-radius: 6px; border: 1px solid var(--line2);
  background: linear-gradient(#2c2620, #231e19); color: var(--text); cursor: pointer;
  font-weight: 600; font-size: 13px; white-space: nowrap; transition: border-color .15s, background .15s, transform .05s;
}
.btn:hover { border-color: var(--gold); }
.btn:active { transform: translateY(1px); }
.btn:disabled { opacity: .5; cursor: default; }
.btn.primary { background: linear-gradient(#b8863a, #8e6326); border-color: #d4a64a; color: #1a1208; }
.btn.primary:hover { background: linear-gradient(#cf9a45, #a2722c); }
.btn.danger { background: linear-gradient(#7a2c2c, #5c1f1f); border-color: #a04040; }
.btn.ghost { background: transparent; border-color: transparent; }
.btn.ghost:hover { background: rgba(255,255,255,.05); border-color: var(--line2); }
.btn.sm { padding: 4px 8px; font-size: 12px; }
.btn.xs { padding: 2px 6px; font-size: 11px; border-radius: 4px; }
.btn.icon { padding: 5px 8px; }
.btn.on { border-color: var(--gold); box-shadow: inset 0 0 0 1px var(--gold); color: var(--gold2); }

.inp {
  width: 100%; padding: 7px 9px; border-radius: 6px; border: 1px solid var(--line);
  background: #110f0d; color: var(--text); font: inherit; outline: none;
}
.inp:focus { border-color: var(--gold); }
textarea.inp { resize: vertical; min-height: 60px; line-height: 1.5; }
select.inp { padding: 6px; }
.inp.color { padding: 2px; height: 34px; cursor: pointer; }
.field { display: flex; flex-direction: column; gap: 4px; margin-bottom: 10px; flex: 1; min-width: 0; }
.field > span { font-size: 11px; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); font-weight: 600; }
.field.sm { flex: 0 0 auto; width: 120px; }
.row { display: flex; gap: 8px; align-items: center; }
.row.wrap { flex-wrap: wrap; }
.grow { flex: 1; }
.muted { color: var(--muted); }
.empty { color: var(--dim); font-size: 12px; padding: 8px; text-align: center; font-style: italic; }
.chk { display: inline-flex; gap: 6px; align-items: center; cursor: pointer; user-select: none; }
.pill { display: inline-block; padding: 1px 8px; border-radius: 99px; font-size: 11px; font-weight: 700; background: var(--panel3); border: 1px solid var(--line2); }

/* --- modales --- */
.modal-back {
  position: fixed; inset: 0; background: rgba(5, 4, 3, .72); display: flex; align-items: center; justify-content: center;
  z-index: 1000; padding: 16px; animation: fade .15s;
}
.modal {
  background: var(--panel); border: 1px solid var(--line2); border-radius: 12px; box-shadow: var(--shadow);
  width: min(460px, 100%); max-height: calc(100vh - 32px); display: flex; flex-direction: column; animation: pop .18s;
}
.modal.wide { width: min(820px, 100%); }
.modal-head { display: flex; align-items: center; justify-content: space-between; padding: 14px 16px 10px; border-bottom: 1px solid var(--line); }
.modal-head h3 { font-size: 17px; color: var(--gold2); }
.modal-head .x { background: none; border: 0; color: var(--muted); font-size: 16px; cursor: pointer; padding: 4px 8px; border-radius: 6px; }
.modal-head .x:hover { background: var(--panel3); color: var(--text); }
.modal-body { padding: 14px 16px; overflow: auto; }
.modal-body p { margin: 0 0 8px; }
.modal-foot { display: flex; justify-content: flex-end; gap: 8px; padding: 10px 16px 14px; border-top: 1px solid var(--line); }
@keyframes fade { from { opacity: 0 } }
@keyframes pop { from { transform: scale(.96); opacity: 0 } }

/* --- toasts --- */
.toasts { position: fixed; right: 16px; bottom: 16px; display: flex; flex-direction: column; gap: 8px; z-index: 2000; max-width: min(380px, calc(100vw - 32px)); }
.toast {
  display: flex; align-items: center; gap: 10px; padding: 10px 12px; border-radius: 8px; background: #1f1b17;
  border: 1px solid var(--line2); box-shadow: var(--shadow); animation: slide .25s; cursor: pointer; flex-wrap: wrap;
}
.toast.out { opacity: 0; transform: translateX(20px); transition: .3s; }
.toast .t-ico { font-size: 16px; }
.toast .t-txt { flex: 1; min-width: 150px; }
.toast .t-act { display: flex; gap: 6px; }
.toast.k-ok { border-color: #3f7a45; } .toast.k-error { border-color: #a04040; } .toast.k-warn { border-color: #a07a30; }
.toast.k-gold, .toast.k-insp { border-color: var(--gold); } .toast.k-trade { border-color: var(--blue); }
@keyframes slide { from { transform: translateX(30px); opacity: 0 } }

/* --- tooltip --- */
.tooltip {
  position: fixed; z-index: 3000; pointer-events: none; display: none; max-width: 280px;
  background: rgba(16, 13, 11, .97); border: 1px solid var(--line2); border-radius: 8px; padding: 8px 10px; box-shadow: var(--shadow);
}
.tt-name { font-family: var(--display); font-weight: 700; font-size: 14px; }
.tt-meta { font-size: 11px; color: var(--muted); margin-top: 2px; }
.tt-desc { font-size: 12px; margin-top: 6px; color: #d8cfbf; white-space: pre-wrap; }

/* --- objetos / inventario --- */
.icon-img { width: 100%; height: 100%; object-fit: contain; pointer-events: none; }
.icon-emoji { line-height: 1; pointer-events: none; filter: drop-shadow(0 2px 2px rgba(0,0,0,.6)); }
.item {
  position: absolute; border-radius: 3px; cursor: grab; touch-action: none; user-select: none;
  background:
    linear-gradient(180deg, rgba(255,255,255,.07), rgba(0,0,0,.18)),
    color-mix(in srgb, var(--ic) 30%, #1a1714);
  border: 1px solid color-mix(in srgb, var(--ic) 55%, #000);
  box-shadow: inset 0 0 0 1px rgba(255,255,255,.05), inset 0 -2px 0 color-mix(in srgb, var(--rc) 70%, transparent);
  overflow: hidden; transition: filter .1s;
}
.item:hover { filter: brightness(1.25); }
.item-inner { position: absolute; left: 50%; top: 50%; display: flex; align-items: center; justify-content: center; padding: 3px; }
.item-name {
  position: absolute; left: 3px; top: 2px; right: 3px; font-size: 9px; font-weight: 700; color: rgba(255,255,255,.75);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis; text-shadow: 0 1px 2px #000; pointer-events: none; letter-spacing: .02em;
}
.item[data-rarity="rara"], .item[data-rarity="muy_rara"], .item[data-rarity="legendaria"] { box-shadow: inset 0 0 12px color-mix(in srgb, var(--rc) 45%, transparent), inset 0 -2px 0 var(--rc); }
.item.drag-src { opacity: .25; }
.item.ghost { position: fixed; z-index: 2500; pointer-events: none; opacity: .92; box-shadow: 0 12px 30px rgba(0,0,0,.6); filter: brightness(1.15); }
.item.loose { position: relative; display: inline-block; flex: 0 0 auto; }

.inv-grid { display: inline-block; }
.inv-slots {
  position: relative;
  background-color: #12100e;
  background-image:
    linear-gradient(to right, rgba(255,255,255,.07) 1px, transparent 1px),
    linear-gradient(to bottom, rgba(255,255,255,.07) 1px, transparent 1px);
  border: 1px solid var(--line2); border-radius: 4px;
  box-shadow: inset 0 0 30px rgba(0,0,0,.6);
}
.inv-hint { position: absolute; display: none; background: rgba(95, 191, 106, .28); border: 2px solid rgba(95, 191, 106, .9); border-radius: 3px; pointer-events: none; z-index: 5; }
.inv-hint.bad { background: rgba(214, 80, 80, .25); border-color: rgba(214, 80, 80, .9); }
.drop-hover { outline: 2px dashed var(--good) !important; outline-offset: 2px; background-color: rgba(95,191,106,.08) !important; }
.drop-bad { outline: 2px dashed var(--bad) !important; outline-offset: 2px; }
.item-list { display: flex; flex-wrap: wrap; gap: 6px; align-items: flex-start; min-height: 46px; }

/* --- comercio OSRS --- */
.trade-win {
  background: #3e3529; border: 3px solid #5a4b3a; border-radius: 6px; padding: 10px;
  box-shadow: inset 0 0 0 2px #2a231b, var(--shadow); color: #ffcf3f; font-family: var(--font);
}
.tr-head { text-align: center; font-weight: 700; color: #ff981f; font-size: 15px; margin-bottom: 8px; text-shadow: 1px 1px 0 #000; }
.tr-head b { color: #fff; }
.tr-cols { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.tr-col { background: #2e271f; border: 2px solid #1f1a14; border-radius: 4px; padding: 6px; min-height: 150px; display: flex; flex-direction: column; gap: 6px; }
.tr-col h4 { font-family: var(--font); font-size: 12px; color: #ff981f; text-align: center; text-shadow: 1px 1px 0 #000; }
.tr-col.theirs.flash { animation: flashred .5s 6; }
@keyframes flashred { 50% { background: #5a1f1a; } }
.tr-items { display: flex; flex-wrap: wrap; gap: 4px; flex: 1; align-content: flex-start; min-height: 70px; }
.tr-items .empty { color: #a08c6a; width: 100%; }
.tr-gold { display: flex; align-items: center; gap: 6px; font-weight: 700; color: #ffff00; text-shadow: 1px 1px 0 #000; padding: 4px 6px; border-radius: 4px; background: rgba(0,0,0,.25); }
.tr-col.mine .tr-gold { cursor: pointer; }
.tr-col.mine .tr-gold:hover { background: rgba(0,0,0,.45); }
.tr-gold.zero { color: #a08c6a; }
.tr-status { text-align: center; color: #fff; min-height: 20px; margin: 8px 0 6px; font-size: 13px; text-shadow: 1px 1px 0 #000; }
.tr-status.warn { color: #ff4040; font-weight: 700; }
.tr-btns { display: flex; justify-content: center; gap: 10px; }
.tr-btns .btn { min-width: 110px; }
.tr-confirm-q { text-align: center; color: #fff; font-weight: 700; margin-bottom: 8px; }
.tr-list { list-style: none; margin: 0; padding: 0; font-size: 13px; color: #ff981f; }
.tr-list li { padding: 2px 0; }
.tr-list li.gold { color: #ffff00; }
.tr-list li.none { color: #a08c6a; font-style: italic; }
.tr-tools { margin-top: 8px; display: flex; gap: 6px; align-items: center; flex-wrap: wrap; }
.tr-tools .inp { background: #2a231b; border-color: #5a4b3a; color: #ffcf3f; }

/* --- ficha --- */
.sheet-top { display: flex; gap: 10px; flex-wrap: wrap; }
.sec { font-size: 13px; color: var(--gold); margin: 10px 0 8px; }
.sec small { font-family: var(--font); color: var(--dim); font-weight: 400; font-size: 11px; }
.ab-row { display: grid; grid-template-columns: repeat(6, 1fr); gap: 8px; }
.ab-box { background: var(--panel2); border: 1px solid var(--line); border-radius: 8px; padding: 8px 6px; text-align: center; }
.ab-name { font-family: var(--display); font-weight: 700; color: var(--gold); font-size: 12px; }
.ab-score { text-align: center; font-size: 18px; font-weight: 700; padding: 4px; margin: 4px 0; }
.ab-mod { font-size: 15px; font-weight: 700; }
.ab-save { font-size: 11px; color: var(--muted); display: flex; gap: 4px; align-items: center; justify-content: center; margin-top: 4px; cursor: pointer; }
.sk-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 4px; }
.sk { display: flex; align-items: center; gap: 8px; padding: 5px 8px; border-radius: 6px; border: 1px solid var(--line); background: var(--panel2); cursor: pointer; text-align: left; }
.sk:hover { border-color: var(--gold); }
.sk .sk-n { flex: 1; }
.sk .sk-ab { font-size: 10px; color: var(--dim); }
.sk .sk-v { font-weight: 700; min-width: 28px; text-align: right; }
.sk.l1 .sk-dot { color: var(--gold); } .sk.l2 .sk-dot { color: var(--gold2); text-shadow: 0 0 6px var(--gold); }
@media (max-width: 640px) { .ab-row { grid-template-columns: repeat(3, 1fr); } }

/* --- banner de resultado (estilo BG3) --- */
.roll-banner { text-align: center; pointer-events: none; }
.rb-total { font-family: var(--display); font-weight: 900; font-size: 64px; line-height: 1; color: #fff; text-shadow: 0 4px 18px rgba(0,0,0,.8); }
.rb-break { font-size: 15px; color: #d8cfbf; margin-top: 4px; text-shadow: 0 2px 6px #000; }
.rb-verdict { font-family: var(--display); font-weight: 900; font-size: 34px; letter-spacing: .12em; margin-top: 6px; text-shadow: 0 3px 14px rgba(0,0,0,.9); }
.rb-verdict.ok { color: #7fe08a; } .rb-verdict.ko { color: #ff6a5a; }
.rb-crit { font-family: var(--display); font-size: 18px; letter-spacing: .2em; color: var(--gold2); text-shadow: 0 0 14px rgba(240,200,104,.8); }
.rb-crit.min { color: #ff6a5a; text-shadow: 0 0 14px rgba(255,80,80,.7); }
.adv-tag { display: inline-block; font-family: var(--display); font-weight: 700; letter-spacing: .12em; font-size: 12px; padding: 2px 10px; border-radius: 99px; }
.adv-tag.adv { color: #1a1208; background: linear-gradient(#f0c868, #c89838); }
.adv-tag.dis { color: #fff; background: linear-gradient(#b04040, #7a2424); }
.adv-tag.insp { color: #1a1208; background: linear-gradient(#bfe6ff, #6aaee0); }

/* =====================================================================================
   ASPECTO DE JUEGO (madera oscura tallada como en el OBS del DM)
   ===================================================================================== */
.wood { position: relative; }
.wood::before {
  content: ''; position: absolute; inset: -10px; pointer-events: none; z-index: 3;
  border: 52px solid transparent;
  border-image: url('/img/marco.png') 104 / 52px / 0 stretch;
}
.game-bg {
  background:
    radial-gradient(ellipse at 50% 40%, rgba(0,0,0,.35), rgba(0,0,0,.88) 75%),
    linear-gradient(rgba(8,7,6,.62), rgba(8,7,6,.62)),
    url('/img/muro.jpg') center / cover fixed,
    #0b0a09;
}
.gp-title {
  font-family: var(--display); font-weight: 700; font-size: 15px; letter-spacing: .22em; text-transform: uppercase;
  color: #cbb68c; text-align: center; display: flex; align-items: center; gap: 12px; justify-content: center; margin-bottom: 14px;
}
.gp-title::before, .gp-title::after { content: ''; height: 1px; flex: 1; max-width: 120px; background: linear-gradient(90deg, transparent, #6b5a40, transparent); }
.gp-sub { font-family: var(--display); font-size: 11px; letter-spacing: .2em; text-transform: uppercase; color: #8c7b60; margin: 12px 0 6px; }

/* botones de juego */
.btn {
  border-radius: 3px; border: 1px solid #4b3f31; font-family: var(--display); font-weight: 700; letter-spacing: .06em;
  background: linear-gradient(#2a221b, #1a1511); color: #dccaa6; text-transform: none;
  box-shadow: inset 0 1px 0 rgba(255,255,255,.06), 0 2px 4px rgba(0,0,0,.5);
}
.btn:hover { border-color: #b08a4a; color: #f3e2bc; }
.btn.primary { background: linear-gradient(#7a5a2a, #4d3716); border-color: #c09a55; color: #fbecc8; text-shadow: 0 1px 2px #000; }
.btn.primary:hover { background: linear-gradient(#8f6a33, #5c421b); }
.btn.danger { background: linear-gradient(#5a2020, #3a1414); border-color: #8a3a3a; color: #f0d0c8; }
.inp { border-radius: 3px; background: #0d0b0a; border-color: #3a3128; }

/* objetos: solo icono, como en un inventario de juego */
.item {
  border-radius: 2px;
  background:
    radial-gradient(circle at 50% 45%, color-mix(in srgb, var(--rc) 16%, transparent), transparent 72%),
    rgba(255,255,255,.025);
  border: 1px solid rgba(255,255,255,.09);
  box-shadow: inset 0 0 0 1px rgba(0,0,0,.6);
}
.item:hover { filter: none; border-color: rgba(230,200,140,.45); background-color: rgba(255,255,255,.05); }
.item[data-rarity="rara"], .item[data-rarity="muy_rara"], .item[data-rarity="legendaria"] { box-shadow: inset 0 0 14px color-mix(in srgb, var(--rc) 35%, transparent); }
.item-name { display: none; }
.icon-emoji { filter: drop-shadow(0 3px 3px rgba(0,0,0,.8)) saturate(.85); }
.inv-slots {
  background-color: #0a0908;
  background-image:
    linear-gradient(to right, #26201a 1px, transparent 1px),
    linear-gradient(to bottom, #26201a 1px, transparent 1px);
  border: 1px solid #3a3128; border-radius: 0;
  box-shadow: inset 0 0 40px rgba(0,0,0,.8), 0 0 0 1px #000;
}

/* ventanas y avisos */
.modal-back { background: rgba(0,0,0,.72); }
.modal { border-radius: 2px; border: 0; background: #12100e; box-shadow: 0 30px 80px rgba(0,0,0,.8); position: relative; }
.modal::before {
  content: ''; position: absolute; inset: -10px; pointer-events: none; z-index: 3;
  border: 52px solid transparent; border-image: url('/img/marco.png') 104 / 52px / 0 stretch;
}
.modal-head { border-bottom: 1px solid #2a231c; padding: 22px 26px 10px; }
.modal-head h3 { color: #d8c49a; letter-spacing: .12em; text-transform: uppercase; font-size: 15px; }
.modal-head .x { position: relative; z-index: 4; }
.modal-body { padding: 14px 26px; }
.modal-foot { border-top: 1px solid #2a231c; padding: 12px 26px 22px; }
.toasts { left: 50%; right: auto; transform: translateX(-50%); bottom: 26px; align-items: center; }
.toast { background: rgba(14,11,9,.95); border: 1px solid #5a4a36; border-radius: 2px; font-family: var(--display); letter-spacing: .03em; color: #e8d8b8; }
.tooltip { border-radius: 2px; border-color: #5a4a36; background: rgba(10,8,7,.97); }

/* =====================================================================================
   TAMAÑOS GRANDES (fácil de leer)
   ===================================================================================== */
body { font-size: 17px; line-height: 1.5; }
.btn { font-size: 16px; padding: 10px 18px; gap: 8px; }
.btn.sm { font-size: 15px; padding: 7px 13px; }
.btn.xs { font-size: 14px; padding: 5px 10px; }
.btn.big { font-size: 18px; padding: 12px 32px; }
.inp { font-size: 17px; padding: 9px 12px; }
.field > span { font-size: 13px; }
.hint, .empty { font-size: 15px; }
.muted.small, .small { font-size: 14px; }
.modal-head h3 { font-size: 19px; }
.modal-body { font-size: 17px; }
.toast { font-size: 17px; padding: 14px 18px; }
.tooltip { max-width: 340px; }
.tt-name { font-size: 18px; } .tt-meta { font-size: 14px; } .tt-desc { font-size: 15px; }
.tr-head { font-size: 18px; } .tr-col h4 { font-size: 15px; } .tr-gold { font-size: 16px; } .tr-status { font-size: 16px; } .tr-list { font-size: 16px; }
.seg button { font-size: 15px; padding: 8px 14px; }
.chk { font-size: 16px; }
.rb-break { font-size: 18px; }
.adv-tag { font-size: 14px; padding: 3px 12px; }

/* --- Monedas en el comercio --- */
.tr-coins { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 8px; margin-top: 6px; font-size: 14px; }
.tr-coins.zero { color: #6f6455; font-style: italic; font-size: 13px; }
.tr-coin { display: inline-flex; align-items: center; gap: 3px; padding: 2px 7px 2px 2px; background: rgba(0,0,0,.35); border: 1px solid #3a3026; color: #e8d7b0; }
.tr-coin img { width: 24px; height: 24px; object-fit: contain; }
.tr-coin small { color: #8c7b60; }
.tr-coin.edit { cursor: pointer; } .tr-coin.edit:hover { border-color: #b08a4a; }
.tr-coin-total { font-size: 12px; color: #a99670; }
.tr-dm-coins { display: flex; flex-wrap: wrap; align-items: center; gap: 4px; margin-top: 8px; }
.tr-add-coin { display: inline-flex; align-items: center; gap: 2px; padding: 2px 6px 2px 2px; background: #0d0b09; border: 1px solid #3a3026; color: #cbbd9f; cursor: pointer; }
.tr-add-coin:hover { border-color: #b08a4a; }
.tr-add-coin img { width: 22px; height: 22px; object-fit: contain; }
.li-coin { width: 18px; height: 18px; object-fit: contain; vertical-align: middle; margin-right: 4px; }
.coin-chips { display: inline-flex; flex-wrap: wrap; gap: 2px 8px; align-items: center; }
.coin-chip { display: inline-flex; align-items: center; gap: 3px; }
.coin-chip.zero { opacity: .35; }
.coin-chip small { color: #8c7b60; font-size: 11px; }

/* --- Equipo puesto: silueta con huecos junto a la mochila --- */
.inv-body { width: 100%; display: flex; gap: 28px; align-items: flex-start; justify-content: center; }
.inv-col { display: flex; flex-direction: column; align-items: center; min-width: 0; }
.inv-col > .gp-sub { margin-top: 0; align-self: stretch; text-align: center; border-bottom: 1px solid #2c251e; padding-bottom: 6px; margin-bottom: 10px; }
.bag-col { flex: 1 1 auto; }
.doll-wrap { position: relative; flex: none; width: 300px; height: 460px; }
.doll-fig { position: absolute; left: 72px; top: 34px; width: 156px; height: 352px; background: no-repeat center bottom / contain;
  filter: grayscale(.55) brightness(.42) drop-shadow(0 0 14px rgba(0,0,0,.9)); pointer-events: none; }
.doll-fig.generic { background: radial-gradient(ellipse at 50% 18%, rgba(120,100,70,.25) 0 9%, transparent 10%), radial-gradient(ellipse at 50% 52%, rgba(120,100,70,.18) 0 22%, transparent 23%); }
.eq-slot { position: absolute; width: 62px; height: 62px; display: flex; align-items: center; justify-content: center; text-align: center;
  background: rgba(10,8,7,.88); border: 1px solid #3a3026; box-shadow: inset 0 0 14px #000; transition: border-color .12s, box-shadow .12s; }
.eq-slot .eq-name { font-family: var(--display); font-size: 10px; letter-spacing: .04em; line-height: 1.1; color: #6f6455; padding: 2px; }
/* hueco vacío: silueta gris de lo que va ahí, como en BG3 */
.eq-slot .eq-ph { width: 44px; height: 44px; object-fit: contain; opacity: .22; pointer-events: none; filter: grayscale(1); transition: opacity .12s; }
.eq-slot:hover .eq-ph, .eq-slot.can .eq-ph { opacity: .45; }
.eq-slot.full { border-color: #6b5a40; cursor: grab; background: rgba(28,22,16,.92); }
.eq-slot .eq-ic { width: 56px; height: 56px; display: flex; align-items: center; justify-content: center; }
.eq-slot .eq-ic .icon-img { width: 100%; height: 100%; object-fit: contain; filter: drop-shadow(0 3px 4px rgba(0,0,0,.8)); }
.eq-slot.can { border-color: #c09a55; box-shadow: 0 0 14px rgba(220,170,80,.4), inset 0 0 14px #000; }
.eq-slot.drop-hover { border-color: #8fdc8a; box-shadow: 0 0 16px rgba(120,220,120,.45), inset 0 0 14px #000; }
.eq-slot.drop-bad { border-color: #c0503a; }
.eq-slot.drag-src .eq-ic { opacity: .25; }
@media (max-width: 760px) { .inv-body { flex-direction: column; align-items: center; } .bag-col { align-self: stretch; } }


/* los dados (d8, 1d6…) en negrita: así se ve de un vistazo qué hace daño o cura */
.gl-dice { font-weight: 800; }

/* --- Controles propios (nada que recuerde a Windows) --- */
input[type=number] { -moz-appearance: textfield; appearance: textfield; }
input[type=number]::-webkit-outer-spin-button, input[type=number]::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
.num-step { display: inline-flex; align-items: stretch; vertical-align: middle; max-width: 100%; }
.num-step > input { text-align: center; border-radius: 0 !important; min-width: 0; flex: 1 1 auto; }
.ns-b { flex: 0 0 auto; width: 24px; padding: 0; cursor: pointer; font-family: var(--display); font-weight: 700; font-size: 16px; line-height: 1;
  color: #e3cf9f; background: linear-gradient(180deg, #2e241a, #15100c); border: 1px solid #4a3d2c; box-shadow: inset 0 1px 0 rgba(255,230,170,.08); }
.ns-b:first-child { border-right: 0; border-radius: 4px 0 0 4px; }
.ns-b:last-child { border-left: 0; border-radius: 0 4px 4px 0; }
.ns-b:hover { color: #fff3d6; border-color: #c09a55; background: linear-gradient(180deg, #46351f, #1d1610); }
.ns-b:active { background: linear-gradient(180deg, #15100c, #2e241a); }
.num-step:has(input:disabled) { opacity: .4; pointer-events: none; }

input[type=checkbox] { appearance: none; -webkit-appearance: none; margin: 0; flex: 0 0 auto; width: 18px; height: 18px; display: inline-grid; place-content: center;
  background: #0d0b09; border: 1px solid #6b5a40; border-radius: 3px; box-shadow: inset 0 0 6px #000; cursor: pointer; vertical-align: middle; transition: border-color .12s; }
input[type=checkbox]::after { content: ''; width: 11px; height: 11px; transform: scale(0); transition: transform .12s cubic-bezier(.2, 1.6, .5, 1);
  background: linear-gradient(180deg, #ffe08a, #c9922e); clip-path: polygon(14% 44%, 0 65%, 50% 100%, 100% 16%, 80% 0%, 43% 62%); }
input[type=checkbox]:checked { border-color: #c9a45a; box-shadow: inset 0 0 6px #000, 0 0 8px rgba(220,170,80,.3); }
input[type=checkbox]:checked::after { transform: scale(1); }
input[type=checkbox]:hover { border-color: #c09a55; }

.sel { position: relative; display: inline-block; min-width: 0; max-width: 100%; }
.field .sel, .sel:has(> .sel-b.inp) { display: block; width: 100%; }
.sel-native { display: none !important; }
.sel-b { cursor: pointer; text-align: left; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; padding-right: 30px !important;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 8'%3E%3Cpath d='M1 1l5 5 5-5' fill='none' stroke='%23c9a45a' stroke-width='1.8'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 10px center; background-size: 12px 8px; }
.sel-b:disabled { opacity: .5; cursor: default; }
.sel-pop { position: fixed; z-index: 10060; overflow: auto; padding: 4px 0; background: linear-gradient(180deg, #1d1813, #110e0b);
  border: 1px solid #7a6240; box-shadow: 0 12px 34px rgba(0,0,0,.8), inset 0 0 0 1px rgba(0,0,0,.6); }
.sel-o { display: block; width: 100%; text-align: left; padding: 7px 14px; background: none; border: 0; color: #d8c9a8; font: inherit; cursor: pointer; white-space: nowrap; }
.sel-o:hover { background: linear-gradient(90deg, rgba(201,164,90,.18), transparent); color: #fff3d6; }
.sel-o.on { color: #ffd75a; }
.sel-o.off { opacity: .4; cursor: default; }

::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-thumb { background: linear-gradient(180deg, #5a4830, #3a2d1e); border-radius: 6px; border: 2px solid transparent; background-clip: padding-box; }
::-webkit-scrollbar-thumb:hover { background: linear-gradient(180deg, #8a6c40, #5a4830); background-clip: padding-box; border: 2px solid transparent; }
::-webkit-scrollbar-track { background: rgba(0,0,0,.25); }
::-webkit-scrollbar-corner { background: transparent; }

/* iconos propios en lugar de emojis (se ponen solos, ver ui.js) */
.emo-ic { display: inline-block; width: 1.3em; height: 1.3em; vertical-align: -.3em; object-fit: contain; margin: 0 .08em;
  filter: drop-shadow(0 0 2px rgba(0,0,0,.7)); pointer-events: none; }
.emo-ic.down { transform: rotate(180deg); }
.t-ico .emo-ic { width: 22px; height: 22px; vertical-align: middle; }

/* --- Catálogo visual / alijo / tiendas: pestañas, filtros por tipo y tarjetas grandes (DM y jugador) --- */
.ib { display: flex; flex-direction: column; gap: 8px; min-width: 0; }
.ib-tabs { display: flex; flex-wrap: wrap; gap: 4px; }
.ib-tab { display: inline-flex; align-items: center; gap: 6px; padding: 5px 10px 5px 6px; background: #0e0c0a; border: 1px solid #2f271f; color: #b9a684;
  font-family: var(--display); font-size: 13px; cursor: pointer; max-width: 220px; }
.ib-tab span { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ib-tab img { width: 22px; height: 22px; object-fit: contain; }
.ib-tab small { font-family: var(--font); color: #7d6d55; font-size: 11px; }
.ib-tab:hover { border-color: #6b5a40; color: #ecd3a0; }
.ib-tab.on { border-color: #c9a45a; background: linear-gradient(180deg, #2a2016, #15100c); color: #ffe8b4; box-shadow: 0 0 10px rgba(220,170,80,.25); }
.ib-tab.drop-hover { border-color: #8fdc8a; box-shadow: 0 0 12px rgba(120,220,120,.4); }
.ib-tools { display: flex; align-items: center; gap: 6px; }
.ib-q-ic { width: 22px; height: 22px; object-fit: contain; opacity: .8; }
.ib-q { flex: 1; min-width: 0; }
.ib-tools .sel { flex: 0 0 140px; }
.ib-chips { display: flex; flex-wrap: wrap; gap: 4px; }
.ib-chip { display: inline-flex; align-items: center; gap: 5px; padding: 3px 9px 3px 4px; border: 1px solid #2a231c; background: #0b0a08; color: #a99670; font-size: 12px; cursor: pointer; }
.ib-chip img { width: 22px; height: 22px; object-fit: contain; }
.ib-chip small { color: #6f6455; }
.ib-chip:hover { border-color: #6b5a40; color: #e9d3a0; }
.ib-chip.on { border-color: #c9a45a; color: #ffe8b4; background: #1d160f; }
.ib-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(118px, 1fr)); gap: 8px; min-height: 90px; padding: 2px; }
.ib-grid.drop-hover { outline: 1px dashed #8fdc8a; }
.ib-card { position: relative; display: flex; flex-direction: column; align-items: center; gap: 3px; padding: 8px 6px 6px; cursor: grab;
  background: radial-gradient(ellipse at 50% 30%, color-mix(in srgb, var(--rc) 16%, #1a1510), #0c0a08 75%);
  border: 1px solid color-mix(in srgb, var(--rc) 45%, #2a231c); transition: transform .12s, border-color .12s, box-shadow .12s; }
.ib-card:hover { transform: translateY(-2px); border-color: color-mix(in srgb, var(--rc) 80%, #c9a45a); box-shadow: 0 6px 16px rgba(0,0,0,.6), 0 0 12px color-mix(in srgb, var(--rc) 30%, transparent); }
.ib-card.drag-src { opacity: .35; }
.ib-img { width: 74px; height: 74px; display: flex; align-items: center; justify-content: center; }
.ib-img .icon-img { width: 100%; height: 100%; object-fit: contain; filter: drop-shadow(0 4px 5px rgba(0,0,0,.8)); }
.ib-cat { position: absolute; left: 4px; top: 4px; width: 20px; height: 20px; object-fit: contain; opacity: .75; }
.ib-name { font-family: var(--display); font-size: 13px; line-height: 1.15; color: #f0dfb8; text-align: center; min-height: 2.3em; display: flex; align-items: center; }
.ib-foot { align-self: stretch; display: flex; justify-content: space-between; align-items: center; gap: 4px; font-size: 12px; }
.ib-price { display: inline-flex; align-items: center; gap: 3px; color: #ffd75a; font-family: var(--display); font-weight: 700; font-size: 14px; }
.ib-price img { width: 16px; height: 16px; object-fit: contain; }
.ib-price small { font-family: var(--font); font-weight: 400; font-size: 11px; color: #c9a24f; }
.ib-price.free { color: #6f6455; font-family: var(--font); font-weight: 400; font-size: 11px; font-style: italic; }
.ib-size { color: #6f6455; font-size: 11px; }
.ib-acts { position: absolute; right: 3px; top: 3px; display: flex; flex-direction: column; gap: 3px; opacity: 0; transition: opacity .12s; }
.ib-card:hover .ib-acts { opacity: 1; }
.ib-act { width: 28px; height: 28px; display: flex; align-items: center; justify-content: center; padding: 2px; cursor: pointer;
  background: rgba(12,10,8,.92); border: 1px solid #5a4a36; }
.ib-act img { width: 100%; height: 100%; object-fit: contain; }
.ib-act:hover { border-color: #c9a45a; background: #2a2016; }
.ib-act.danger:hover { border-color: #c0503a; background: #2a1210; }
.ib-empty { grid-column: 1 / -1; padding: 22px 10px; text-align: center; color: #6f6455; font-style: italic; border: 1px dashed #2a231c; }

/* --- comercio: lo que pide el DM (regateo) --- */
.tr-ask { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-top: 8px; padding: 6px 10px; border: 1px solid #5a4a36; background: rgba(40,30,16,.5); color: #cbbd9f; }
.tr-ask b { font-family: var(--display); font-size: 18px; color: #ffd75a; }
.tr-ask small { color: #8f8068; }
.tr-ask.ok { border-color: #3f6a45; }
.tr-ask .grow { flex: 1; }

.tr-worth { font-size: 12px; color: #c9a24f; margin: 2px 0; }
.tr-worth small { color: #8f8068; }

/* --- espacios de conjuro y recursos de clase (como en BG3) --- */
.gems { display: inline-flex; gap: 5px; align-items: center; flex-wrap: wrap; }
.gem { width: 14px; height: 14px; padding: 0; transform: rotate(45deg); border: 1px solid #5a4a36; background: #0d0b09; cursor: pointer; transition: box-shadow .15s, background .15s; }
.gem:disabled { cursor: default; }
.gem.slot.full { background: radial-gradient(circle at 35% 35%, #d9e4ff, #5b7dff 55%, #23318a); border-color: #9fb4ff; box-shadow: 0 0 8px rgba(110,140,255,.7); }
.gem.pact.full { background: radial-gradient(circle at 35% 35%, #f0d9ff, #a35bff 55%, #4a1f8a); border-color: #cfa4ff; box-shadow: 0 0 8px rgba(170,110,255,.7); }
.gem.res.full { background: radial-gradient(circle at 35% 35%, #fff2c8, #e0a23a 55%, #7a4a12); border-color: #f0c070; box-shadow: 0 0 8px rgba(240,170,70,.6); }
.gem:not(:disabled):hover { box-shadow: 0 0 10px rgba(255,255,255,.45); }
.pw-strip { display: inline-flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.pw-chip { display: inline-flex; align-items: center; gap: 4px; font-size: 12px; color: #cbbd9f; }
.pw-chip img { width: 18px; height: 18px; object-fit: contain; }
.pw-chip em { font-style: normal; font-family: var(--display); font-size: 11px; color: #9fb4ff; }
.pw-chip .gem { width: 10px; height: 10px; }
.pw-chip .gems { gap: 4px; }

/* --- puntos de golpe --- */
.hpb { display: inline-flex; align-items: center; gap: 6px; }
.hpb-track { position: relative; width: 90px; height: 8px; background: #1a0f0c; border: 1px solid #4a2a22; overflow: hidden; }
.hpb.big .hpb-track { width: 100%; height: 14px; }
.hpb.big { display: flex; width: 100%; }
.hpb.big .hpb-track { flex: 1; }
.hpb-fill { position: absolute; inset: 0 auto 0 0; background: linear-gradient(180deg, #7fd36a, #3d8a2c); transition: width .4s; }
.hpb.mid .hpb-fill { background: linear-gradient(180deg, #f0c060, #a8741c); }
.hpb.low .hpb-fill { background: linear-gradient(180deg, #ff7a62, #a3281a); }
.hpb-temp { position: absolute; inset: 0 auto 0 0; background: rgba(110,160,255,.55); border-right: 2px solid #9fc0ff; }
.hpb-txt { font-size: 12px; color: #cbbd9f; white-space: nowrap; }
.hpb-txt b { color: #f0e0bc; font-family: var(--display); }
.hpb.big .hpb-txt { font-size: 15px; }
.hpb.big .hpb-txt b { font-size: 20px; }
.hpb-txt em { font-style: normal; color: #9fc0ff; }
.tt-act { margin-top: 4px; color: #c9a24f; font-size: 12px; }

/* CA: un escudo con el número */
.ac-badge { position: relative; flex: none; width: 34px; height: 38px; display: flex; flex-direction: column; align-items: center; justify-content: center; padding-bottom: 4px; cursor: default;
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 36 40'%3E%3Cdefs%3E%3ClinearGradient id='g' x1='0' y1='0' x2='0' y2='1'%3E%3Cstop offset='0' stop-color='%23463a28'/%3E%3Cstop offset='1' stop-color='%23171109'/%3E%3C/linearGradient%3E%3C/defs%3E%3Cpath d='M18 1.5 34 6v14c0 10-7 16.5-16 18.5C9 36.5 2 30 2 20V6z' fill='url(%23g)' stroke='%23c8a35e' stroke-width='1.6'/%3E%3Cpath d='M18 4.5 31 8.3V20c0 8.3-5.6 13.6-13 15.4C10.6 33.6 5 28.3 5 20V8.3z' fill='none' stroke='%23c8a35e' stroke-opacity='.35' stroke-width='.8'/%3E%3C/svg%3E") center / contain no-repeat; }
.ac-badge b { font-family: var(--display, Cinzel, Georgia, serif); font-size: 15px; line-height: 1; color: #f6e6bf; text-shadow: 0 1px 2px #000; }
.ac-badge small { font-size: 7px; letter-spacing: .12em; color: #c8a35e; line-height: 1; margin-top: 1px; }
.ac-badge.big { width: 42px; height: 47px; }
.ac-badge.big b { font-size: 19px; }
.ac-badge.big small { font-size: 8px; }
/* la tuerca y el selector de aspecto de los dados */
.dice-gear { width: 26px; height: 26px; padding: 2px; border: 1px solid transparent; background: none; cursor: pointer; border-radius: 50%; opacity: .75; transition: opacity .15s, transform .4s; }
.dice-gear img { width: 100%; height: 100%; display: block; pointer-events: none; }
.dice-gear:hover { opacity: 1; transform: rotate(60deg); }
.skin-pop { position: fixed; z-index: 3000; width: 316px; padding: 10px 12px 12px; background: linear-gradient(#1b150f, #0f0b08); border: 1px solid #5a4630; box-shadow: 0 12px 40px rgba(0,0,0,.7), inset 0 0 0 1px rgba(200,163,94,.12); }
.skin-pop-h { font-family: var(--display, Cinzel, Georgia, serif); color: #e8cf98; font-size: 14px; margin-bottom: 8px; letter-spacing: .04em; }
.skin-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; }
.skin-opt { display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 6px 2px 5px; background: #0d0a07; border: 1px solid #2a2118; cursor: pointer; color: #b9a988; font-size: 11px; }
.skin-opt:hover { border-color: #6b5a40; color: #f0e2c0; }
.skin-opt.on { border-color: #c8a35e; background: #1f180f; color: #fff0cf; box-shadow: inset 0 0 12px rgba(200,163,94,.18); }
.skin-opt .skin-sw { width: 60px; height: 60px; filter: drop-shadow(0 3px 4px rgba(0,0,0,.7)); }
/* curación en el resultado de los dados */
.rf-heal { font-family: var(--display, Cinzel, Georgia, serif); font-weight: 900; font-size: 20px; color: #8fe08a; text-shadow: 0 0 12px rgba(120,220,110,.55), 0 2px 3px #000; }

/* fichas con el icono de lo que se señala */
.tooltip .tt-has-ic { display: flex; align-items: center; gap: 8px; }
.tooltip .tt-ic { width: 30px; height: 30px; object-fit: contain; flex: none; filter: drop-shadow(0 1px 3px rgba(0,0,0,.6)); }

/* lo que queda de un objeto que se gasta (flechas de un carcaj…) */
.item-qty { position: absolute; right: 2px; bottom: 1px; padding: 0 4px; font-size: 12px; font-weight: 800; color: #f6e6bf; background: rgba(8,6,5,.82); border: 1px solid #4a3a28; pointer-events: none; line-height: 1.3; }

/* la CA: cifras de ancho fijo y alineadas, para que el número quede centrado en el escudo */
.ac-badge b { font-variant-numeric: lining-nums tabular-nums; letter-spacing: 0; text-align: center; min-width: 1.2em; }
.ac-badge.hb-ac { width: 32px; height: 36px; }
.ac-badge.hb-ac b { font-size: 15px; }
