:root {
  --bg: #0b0d13; --ink: #10131b; --panel: #161a25; --panel2: #1c2130; --line: #2a3144; --line2: #394159;
  --text: #e8e3d5; --mute: #8f97ab; --brass: #c9a35c; --brass2: #8d7240; --verd: #4fa3a5; --blood: #c0503f; --ok: #5fae5a;
  --serif: "Iowan Old Style", "Palatino Linotype", "Book Antiqua", Palatino, Georgia, serif;
  --sans: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", sans-serif;
  --r: 8px;
}
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; background: var(--bg); color: var(--text); font: 14px/1.4 var(--sans); overflow: hidden; -webkit-tap-highlight-color: transparent; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
[hidden] { display: none !important; }
:focus-visible { outline: 2px solid var(--verd); outline-offset: 1px; }
::-webkit-scrollbar { width: 9px; height: 9px; } ::-webkit-scrollbar-thumb { background: var(--line2); border-radius: 9px; } ::-webkit-scrollbar-track { background: transparent; }

/* ---------- login ---------- */
#login { position: fixed; inset: 0; display: grid; place-items: center; z-index: 50;
  background: radial-gradient(ellipse at 50% 30%, #1b2133 0%, #0b0d13 70%); padding: 16px; }
#loginForm { width: min(380px, 100%); background: var(--panel); border: 1px solid var(--line); border-radius: 14px; padding: 28px 26px 24px; display: grid; gap: 14px; box-shadow: 0 20px 60px #000a; }
#loginForm h1 { margin: 0; font: 600 34px/1 var(--serif); letter-spacing: .01em; color: var(--brass); }
#loginForm .sub { margin: -6px 0 6px; color: var(--mute); }
label { display: grid; gap: 5px; color: var(--mute); font-size: 12.5px; }
input[type=text], input[type=password], input[type=number], input:not([type]), select, textarea {
  width: 100%; background: var(--ink); border: 1px solid var(--line); border-radius: 6px; padding: 8px 10px; color: var(--text); min-width: 0; }
input[type=number] { padding: 6px 8px; }
textarea { resize: vertical; min-height: 70px; }
input[type=color] { width: 100%; height: 34px; padding: 2px; background: var(--ink); border: 1px solid var(--line); border-radius: 6px; }
input[type=range] { width: 100%; accent-color: var(--brass); }
input[type=checkbox] { accent-color: var(--brass); width: 16px; height: 16px; }
.seg { display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; background: var(--ink); border: 1px solid var(--line); border-radius: 8px; padding: 3px; gap: 3px; }
.seg button { background: none; border: 0; border-radius: 6px; padding: 7px 8px; color: var(--mute); }
.seg button.on { background: var(--panel2); color: var(--text); box-shadow: inset 0 0 0 1px var(--brass2); }
button.primary { background: var(--brass); color: #1a1408; border: 0; border-radius: 8px; padding: 10px 14px; font-weight: 650; }
button.primary:hover { filter: brightness(1.08); }
button.btn { background: var(--panel2); border: 1px solid var(--line2); border-radius: 7px; padding: 6px 10px; }
button.btn:hover { border-color: var(--brass2); }
button.btn.danger { border-color: #6b2f28; color: #f1a79b; }
button.btn.sm { padding: 3px 8px; font-size: 12.5px; }
button.btn.on { background: #2a2417; border-color: var(--brass); color: var(--brass); }
.err { color: #f1a79b; min-height: 1.2em; margin: 0; }

/* ---------- layout ---------- */
#app { display: grid; height: 100%; grid-template-columns: 54px 1fr 340px; grid-template-rows: 46px 1fr; grid-template-areas: "top top top" "rail stage side"; }
#top { grid-area: top; display: flex; align-items: center; gap: 10px; padding: 0 10px 0 14px; background: var(--ink); border-bottom: 1px solid var(--line); }
.brand { display: flex; align-items: center; gap: 8px; font: 600 18px var(--serif); color: var(--brass); white-space: nowrap; }
.sigil { font-size: 16px; filter: grayscale(.3); }
#sceneName { color: var(--mute); padding-left: 12px; border-left: 1px solid var(--line); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0; }
.spacer { flex: 1; }
#who { font-size: 12.5px; color: var(--mute); white-space: nowrap; }
#who b { color: var(--text); font-weight: 600; }
.dot { width: 9px; height: 9px; border-radius: 50%; background: var(--blood); box-shadow: 0 0 0 3px #c0503f33; }
.dot.on { background: var(--ok); box-shadow: 0 0 0 3px #5fae5a33; }
.ibtn { width: 32px; height: 32px; border-radius: 7px; background: var(--panel); border: 1px solid var(--line); color: var(--text); font-size: 16px; line-height: 1; }
.ibtn:hover { border-color: var(--brass2); }
.only-narrow { display: none; }

#rail { grid-area: rail; background: var(--ink); border-right: 1px solid var(--line); display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 10px 0; overflow-y: auto; }
#rail .sep { width: 26px; height: 1px; background: var(--line2); margin: 4px 0; }
.tool { position: relative; width: 40px; height: 40px; border-radius: 9px; border: 1px solid transparent; background: none; font-size: 19px; display: grid; place-items: center; }
.tool:hover { background: var(--panel); }
.tool.on { background: #261f12; border-color: var(--brass); box-shadow: inset 0 0 12px #c9a35c22; }
.tool kbd { position: absolute; right: 3px; bottom: 1px; font: 600 9px var(--sans); color: var(--mute); }

#stage { grid-area: stage; position: relative; overflow: hidden; background: #08090d; min-width: 0; min-height: 0; }
#map { position: absolute; inset: 0; display: block; }
#side { grid-area: side; background: var(--panel); border-left: 1px solid var(--line); display: flex; flex-direction: column; min-height: 0; min-width: 0; }
#tabs { display: flex; border-bottom: 1px solid var(--line); background: var(--ink); }
#tabs button { flex: 1; background: none; border: 0; border-bottom: 2px solid transparent; padding: 9px 2px 8px; color: var(--mute); font-size: 12px; display: grid; gap: 1px; justify-items: center; }
#tabs button span:first-child { font-size: 16px; }
#tabs button.on { color: var(--text); border-bottom-color: var(--brass); background: var(--panel); }
#tabs button .badge { position: absolute; }
#panels { flex: 1; min-height: 0; position: relative; }
.panel { position: absolute; inset: 0; display: flex; flex-direction: column; min-height: 0; }
.panel h3 { margin: 0 0 8px; font: 600 15px var(--serif); color: var(--brass); }
.pscroll { flex: 1; overflow-y: auto; padding: 12px; min-height: 0; }
.row { display: flex; align-items: center; gap: 6px; }
.row.wrap { flex-wrap: wrap; }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.grid3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.muted { color: var(--mute); }
.small { font-size: 12.5px; }
.card { background: var(--panel2); border: 1px solid var(--line); border-radius: var(--r); padding: 10px; margin-bottom: 10px; }
.stack { display: grid; gap: 8px; }
hr { border: 0; border-top: 1px solid var(--line); margin: 12px 0; }

/* ---------- barra de opções (sobre o mapa) ---------- */
#optbar { position: absolute; top: 10px; left: 50%; transform: translateX(-50%); max-width: calc(100% - 24px); display: flex; gap: 6px; flex-wrap: wrap; align-items: center; justify-content: center;
  background: #10131be8; backdrop-filter: blur(6px); border: 1px solid var(--line2); border-radius: 10px; padding: 6px 8px; z-index: 5; box-shadow: 0 6px 24px #0008; }
#optbar .lbl { color: var(--mute); font-size: 12px; padding: 0 2px; }
#optbar .chip { background: var(--panel); border: 1px solid var(--line); border-radius: 7px; padding: 4px 9px; font-size: 12.5px; }
#optbar .chip.on { border-color: var(--brass); color: var(--brass); background: #231d10; }
#optbar .vs { width: 1px; height: 20px; background: var(--line2); }
#optbar input[type=range] { width: 110px; }
#banner { position: absolute; top: 10px; left: 50%; transform: translateX(-50%); z-index: 4; background: #241c0cee; border: 1px solid var(--brass); color: #f6dfa3; border-radius: 999px; padding: 5px 8px 5px 16px; display: flex; gap: 10px; align-items: center; box-shadow: 0 4px 20px #000a; font-family: var(--serif); font-size: 15px; }
#optbar:not([hidden]) ~ #banner { top: 58px; }

/* ---------- bandeja de dados ---------- */
#tray { position: absolute; left: 50%; bottom: 10px; transform: translateX(-50%); z-index: 5; width: max-content; max-width: calc(100% - 20px); grid-template-columns: minmax(0, 1fr); background: #10131bee; backdrop-filter: blur(6px); border: 1px solid var(--line2); border-radius: 12px; padding: 7px 8px; display: grid; gap: 6px; box-shadow: 0 6px 24px #000a; }
#tray .dice { display: flex; gap: 4px; flex-wrap: wrap; justify-content: center; }
#tray .die { min-width: 38px; padding: 5px 6px; background: var(--panel2); border: 1px solid var(--line2); border-radius: 7px; font-weight: 650; font-size: 12.5px; }
#tray .die:hover { border-color: var(--brass); color: var(--brass); }
#tray .fline { display: flex; gap: 5px; align-items: center; flex-wrap: wrap; }
#tray .fline input { flex: 1; min-width: 90px; padding: 6px 9px; }
#tray .fline select { width: auto; padding: 6px 4px; }
#tray .macros { display: flex; gap: 4px; flex-wrap: wrap; justify-content: center; }
#tray .macros .m { background: #1d2538; border: 1px solid #2f3b58; border-radius: 999px; padding: 2px 4px 2px 10px; font-size: 12px; display: inline-flex; gap: 6px; align-items: center; }
#tray .macros .m button { background: none; border: 0; color: var(--mute); padding: 0 3px; }
#tray.min .dice, #tray.min .macros, #tray.min .fline > :not(.tog) { display: none; }

/* ---------- chat ---------- */
#chatLog { flex: 1; overflow-y: auto; padding: 10px 12px; display: flex; flex-direction: column; gap: 7px; min-height: 0; }
.msg { font-size: 13.5px; word-wrap: anywhere; }
.msg .who { font-weight: 650; }
.msg.sys { color: var(--mute); font-style: italic; font-size: 12.5px; }
.msg.whisper { background: #2a1d33; border-left: 3px solid #a066c9; padding: 4px 8px; border-radius: 0 6px 6px 0; }
.msg.emote { color: #d6c8a0; font-style: italic; }
.msg.roll { background: var(--panel2); border: 1px solid var(--line); border-radius: 8px; padding: 6px 9px; display: grid; gap: 1px; }
.msg.roll.priv { border-left: 3px solid #a066c9; }
.msg.roll .top { display: flex; gap: 8px; align-items: baseline; justify-content: space-between; }
.msg.roll .formula { color: var(--mute); font-size: 12.5px; }
.msg.roll .detail { color: var(--mute); font-size: 12.5px; font-variant-numeric: tabular-nums; }
.msg.roll .total { font: 700 24px var(--serif); line-height: 1; }
.msg.roll.max .total { color: #ffd65a; text-shadow: 0 0 12px #ffb81f88; }
.msg.roll.min .total { color: #ff7a6a; }
.msg .tag { font-size: 11px; color: #c9a2e6; margin-left: 4px; }
#chatForm { display: flex; gap: 6px; padding: 8px; border-top: 1px solid var(--line); background: var(--ink); }
#chatForm input { flex: 1; }

#rollpops { position: fixed; top: 62px; left: 50%; transform: translateX(-50%); display: grid; gap: 8px; z-index: 40; pointer-events: none; justify-items: center; }
.rollpop { background: #17120a; border: 1px solid var(--brass); border-radius: 12px; padding: 8px 18px; text-align: center; box-shadow: 0 10px 40px #000b; animation: popin .22s ease-out; min-width: 170px; }
.rollpop.out { opacity: 0; transform: translateY(-8px); transition: .35s; }
.rollpop .n { font: 700 40px/1.05 var(--serif); color: #f6dfa3; font-variant-numeric: tabular-nums; }
.rollpop.max .n { color: #ffd65a; text-shadow: 0 0 18px #ffb81f; } .rollpop.min .n { color: #ff7a6a; }
.rollpop .w { font-size: 12.5px; color: var(--mute); }
@keyframes popin { from { transform: translateY(-10px) scale(.9); opacity: 0; } }

/* ---------- iniciativa / listas ---------- */
.list { display: grid; gap: 6px; }
.li { display: flex; align-items: center; gap: 8px; background: var(--panel2); border: 1px solid var(--line); border-radius: 8px; padding: 6px 8px; }
.li.cur { border-color: var(--brass); background: #251e10; box-shadow: inset 3px 0 0 var(--brass); }
.li.sel { border-color: var(--verd); }
.li .name { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.li input[type=number] { width: 56px; }
.swatch { width: 14px; height: 14px; border-radius: 50%; border: 2px solid #0008; flex: none; }
.pill { font-size: 11px; padding: 1px 7px; border-radius: 999px; background: var(--ink); border: 1px solid var(--line2); color: var(--mute); }
.pill.gm { color: var(--brass); border-color: var(--brass2); }

/* ---------- inspetor ---------- */
#insp { position: absolute; z-index: 6; right: 12px; top: 56px; width: 288px; max-height: calc(100% - 70px); overflow-y: auto; background: #131723f2; backdrop-filter: blur(8px); border: 1px solid var(--line2); border-radius: 12px; padding: 12px; box-shadow: 0 10px 40px #000a; }
#insp h4 { margin: 0 0 8px; font: 600 16px var(--serif); color: var(--brass); display: flex; justify-content: space-between; align-items: center; gap: 8px; }
#insp .x { background: none; border: 0; color: var(--mute); font-size: 18px; }
.hpbar { height: 10px; border-radius: 6px; background: #0a0b10; overflow: hidden; border: 1px solid var(--line); }
.hpbar i { display: block; height: 100%; }
.conds { display: grid; grid-template-columns: repeat(8, 1fr); gap: 4px; }
.conds button { aspect-ratio: 1; border-radius: 7px; border: 1px solid var(--line); background: var(--ink); font-size: 15px; padding: 0; }
.conds button.on { border-color: var(--brass); background: #2a2417; }
.field { display: grid; gap: 3px; }
.field > span { color: var(--mute); font-size: 12px; }
.chk { display: flex; align-items: center; gap: 8px; color: var(--text); font-size: 13px; }

/* ---------- modal ---------- */
#modalRoot .back { position: fixed; inset: 0; background: #05060acc; z-index: 60; display: grid; place-items: center; padding: 14px; }
#modalRoot .modal { width: min(460px, 100%); max-height: 92vh; display: flex; flex-direction: column; background: var(--panel); border: 1px solid var(--line2); border-radius: 14px; box-shadow: 0 30px 80px #000c; }
#modalRoot .modal.wide { width: min(780px, 100%); }
#modalRoot .mh { padding: 14px 16px 0; display: flex; justify-content: space-between; align-items: center; }
#modalRoot .mh h3 { margin: 0; font: 600 20px var(--serif); color: var(--brass); }
#modalRoot .mb { padding: 12px 16px; overflow-y: auto; }
#modalRoot .mf { padding: 10px 16px 14px; display: flex; gap: 8px; justify-content: flex-end; }
.libgrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(96px, 1fr)); gap: 8px; }
.libgrid button { padding: 0; background: var(--ink); border: 1px solid var(--line); border-radius: 8px; overflow: hidden; aspect-ratio: 1; }
.libgrid button:hover { border-color: var(--brass); }
.libgrid img { width: 100%; height: 100%; object-fit: cover; display: block; }
.attrs { display: grid; grid-template-columns: repeat(6, 1fr); gap: 6px; }
.attr { background: var(--ink); border: 1px solid var(--line); border-radius: 9px; padding: 6px 4px; text-align: center; display: grid; gap: 3px; }
.attr b { font-size: 11px; color: var(--mute); letter-spacing: .06em; }
.attr button { background: var(--panel2); border: 1px solid var(--line2); border-radius: 7px; font: 700 18px var(--serif); padding: 2px 0; }
.attr button:hover { border-color: var(--brass); color: var(--brass); }
.attr input { text-align: center; padding: 3px; }
.handout img { max-width: 100%; max-height: 70vh; display: block; margin: 0 auto; border-radius: 8px; }

#toasts { position: fixed; bottom: 14px; left: 50%; transform: translateX(-50%); display: grid; gap: 6px; z-index: 80; justify-items: center; pointer-events: none; }
.toast { background: #1d2231; border: 1px solid var(--line2); border-radius: 9px; padding: 8px 14px; box-shadow: 0 6px 24px #000a; animation: popin .2s; max-width: 90vw; }
.toast.err { border-color: #7a3a30; color: #f4b6ab; }

/* ---------- telas estreitas ---------- */
@media (max-width: 860px) {
  #app { grid-template-columns: 46px 1fr; grid-template-areas: "top top" "rail stage"; }
  .only-narrow { display: inline-block; }
  #side { position: fixed; left: 0; right: 0; bottom: 0; height: 58vh; z-index: 20; transform: translateY(100%); transition: transform .22s; border-left: 0; border-top: 1px solid var(--line2); border-radius: 14px 14px 0 0; box-shadow: 0 -10px 40px #000a; }
  #side.open { transform: none; }
  #insp { left: 8px; right: 8px; width: auto; top: auto; bottom: 8px; max-height: 46vh; }
  .tool { width: 36px; height: 36px; font-size: 17px; }
  #sceneName, #who { display: none; }
  #tray { bottom: 6px; }
}
@media (prefers-reduced-motion: reduce) { * { animation: none !important; transition: none !important; } }

#hint { position: absolute; inset: 0; display: grid; place-items: center; z-index: 3; pointer-events: none; text-align: center; padding: 24px; }
#hint div { background: #10131bdd; border: 1px solid var(--line2); border-radius: 14px; padding: 18px 24px; max-width: 360px; }
#hint b { font: 600 20px var(--serif); color: var(--brass); display: block; margin-bottom: 6px; }

/* ---------- ficha por modelo ---------- */
.sheet { display: flex; flex-direction: column; gap: 10px; min-height: 52vh; }
.stabs { display: flex; gap: 4px; flex-wrap: wrap; border-bottom: 1px solid var(--line); padding-bottom: 6px; }
.stabs button { background: var(--ink); border: 1px solid var(--line); border-radius: 8px 8px 0 0; padding: 6px 12px; color: var(--mute); }
.stabs button.on { background: #2a2417; border-color: var(--brass); color: var(--brass); }
.stabs button.add { border-style: dashed; }
.sgrid { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 10px 12px; align-items: start; }
.sf h5 { margin: 8px 0 0; font: 700 15px var(--serif); color: var(--brass); border-bottom: 1px solid var(--line); padding-bottom: 3px; }
.sf .attr b { letter-spacing: 0; text-transform: none; font-size: 12px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sf .attr button:disabled { opacity: .5; }
.sf input:disabled, .sf textarea:disabled, .sf select:disabled { opacity: .75; background: transparent; border-style: dashed; }
.res { gap: 6px; flex-wrap: nowrap; }
.res input { width: 64px; text-align: center; }
.listf .lrows { display: grid; gap: 5px; }
.lrow, .lhead { display: grid; gap: 6px; align-items: center; }
.lhead { font-size: 11px; color: var(--mute); padding: 0 2px; }
.lc { display: flex; gap: 4px; }
.lc input { min-width: 0; }
.ltotal { margin-top: 5px; text-align: right; }
@media (max-width: 640px) { .sgrid { grid-template-columns: repeat(2, minmax(0, 1fr)); } .sf { grid-column: span 2 !important; } .sf-attr { grid-column: span 1 !important; } }

/* ---------- editor da ficha ---------- */
.tpled { display: flex; flex-direction: column; gap: 10px; }
.fcard { border: 1px solid var(--line); background: var(--ink); border-radius: 10px; padding: 8px; display: grid; gap: 8px; }
.fhead input { flex: 1; min-width: 0; }
.fhead select { max-width: 190px; }
.fopts { align-items: flex-end; }
.tabhead input { flex: 1; font-weight: 700; }
.conds button.cfg { border-style: dashed; color: var(--mute); }

/* ---------- notas ---------- */
.notes { display: flex; flex-direction: column; gap: 8px; height: 100%; }
.notes textarea { flex: 1; min-height: 220px; resize: none; line-height: 1.5; }
.nlist { display: flex; gap: 4px; flex-wrap: wrap; }
.nlist button { background: var(--ink); border: 1px solid var(--line); border-radius: 8px; padding: 4px 10px; max-width: 160px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.nlist button.on { border-color: var(--brass); color: var(--brass); background: #2a2417; }
.nlist button.add { border-style: dashed; color: var(--mute); }

/* ---------- janelas flutuantes ---------- */
#winRoot { position: fixed; inset: 0; pointer-events: none; z-index: 50; }
#rollpops { z-index: 58; }
.win { position: fixed; pointer-events: auto; display: flex; flex-direction: column; min-width: 300px; min-height: 120px; max-width: 96vw; max-height: 94vh; background: linear-gradient(180deg, #1a1f2d, #141824); border: 1px solid var(--line2); border-radius: 14px; box-shadow: 0 18px 60px #000c, 0 0 0 1px #0006; resize: both; overflow: hidden; }
.win.front { border-color: var(--brass2); box-shadow: 0 22px 70px #000d, 0 0 0 1px var(--brass2); }
.win.moving { opacity: .92; user-select: none; }
.win.min { resize: none; min-height: 0; }
.win.min .wbody { display: none; }
.whead { display: flex; gap: 6px; align-items: center; padding: 7px 8px 7px 14px; background: #10131b; border-bottom: 1px solid var(--line); cursor: grab; touch-action: none; user-select: none; }
.wtitle { flex: 1; font: 600 15px var(--serif); color: var(--brass); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.wextra { display: flex; gap: 4px; }
.wbtn { background: var(--panel2); border: 1px solid var(--line2); border-radius: 8px; min-width: 28px; height: 28px; color: var(--text); font-size: 14px; line-height: 1; }
.wbtn.txt { padding: 0 9px; font-size: 12px; }
.wbtn:hover { border-color: var(--brass); color: var(--brass); }
.wbody { flex: 1; overflow: auto; padding: 12px 14px 16px; display: flex; flex-direction: column; gap: 10px; min-height: 0; }
@media (max-width: 719px) {
  .win { left: 0 !important; right: 0; bottom: 0; top: auto !important; width: auto !important; height: 78vh !important; max-width: none; border-radius: 16px 16px 0 0; resize: none; }
  .win.min { height: auto !important; }
}

/* ---------- ficha: cabeçalho e cartões ---------- */
.sheet { min-height: 0; }
.shead { display: flex; gap: 12px; align-items: center; padding: 8px; border: 1px solid var(--line); border-radius: 12px; background: radial-gradient(120% 140% at 0 0, #262c3f, #161a25); }
.sface { width: 64px; height: 64px; flex: none; border-radius: 50%; border: 3px solid var(--brass); overflow: hidden; display: grid; place-items: center; font: 700 22px var(--serif); color: #fff; padding: 0; }
.sface.sm { width: 40px; height: 40px; border-width: 2px; font-size: 18px; background: var(--ink); }
.sface img { width: 100%; height: 100%; object-fit: cover; }
.sface.sqf { border-radius: 6px; } .sface.rdf { border-radius: 22%; } .sface.hexf { border-radius: 14%; clip-path: polygon(50% 0, 96% 25%, 96% 75%, 50% 100%, 4% 75%, 4% 25%); border: 0; }
.sfill { flex: 1; min-width: 0; }
.sinfo { display: grid; gap: 4px; }
.sname { font: 700 20px var(--serif); color: var(--text); line-height: 1.1; }
.hpbar.big { position: relative; height: 18px; border-radius: 9px; }
.hpbar.big span { position: absolute; inset: 0; display: grid; place-items: center; font: 700 12px system-ui; color: #fff; text-shadow: 0 1px 2px #000; }
.hpq { gap: 4px; }
.schips { display: flex; gap: 4px; flex-wrap: wrap; margin-top: 6px; }
.chip { min-width: 30px; height: 30px; border-radius: 9px; border: 1px dashed var(--line2); background: transparent; color: var(--text); font-size: 15px; opacity: .55; display: inline-grid; place-items: center; padding: 0 4px; }
button.chip:hover { opacity: 1; border-color: var(--brass); }
.chip.on { opacity: 1; border: 1px solid var(--brass); background: #2a2417; }
.stabs { position: sticky; top: -12px; z-index: 2; background: #141824; padding-top: 4px; }
.sf .attr { background: linear-gradient(180deg, #1c2130, #151925); border-radius: 12px; padding: 8px 6px 7px; gap: 5px; }
.sf .attr b { font-size: 11.5px; color: var(--brass2); }
.sf .attr button.mod { font-size: 22px; padding: 4px 0; border-radius: 10px; background: #0f121a; }
.sf .attr input { background: transparent; border: 0; border-top: 1px solid var(--line); border-radius: 0; font-size: 12px; color: var(--mute); }
.sf .field > span { font-size: 11.5px; }
.sf-check .chk { padding: 6px 8px; border: 1px solid var(--line); border-radius: 8px; background: var(--ink); }
.sf .res input { font-weight: 700; }
.listf { border: 1px solid var(--line); border-radius: 10px; padding: 8px; background: #11141d; }

/* ---------- loja ---------- */
.shop { display: flex; flex-direction: column; gap: 10px; }
.wallet { text-align: right; display: grid; gap: 4px; font-size: 12px; }
.wallet b { display: block; font: 700 20px var(--serif); color: var(--brass); }
.wallet select { max-width: 150px; }
.shoplist { display: grid; gap: 8px; }
.sitem { display: flex; gap: 10px; align-items: center; padding: 8px; border: 1px solid var(--line); border-radius: 12px; background: var(--ink); }
.sitem > img, .sico { width: 46px; height: 46px; border-radius: 9px; object-fit: cover; flex: none; background: #1c2130; display: grid; place-items: center; font-size: 22px; }
.sbuy { display: grid; gap: 4px; justify-items: end; }
.price { font: 700 15px var(--serif); color: var(--brass); white-space: nowrap; }
.qty { width: 58px !important; text-align: center; }
button.primary.sm { padding: 5px 12px; }
button.poor { filter: grayscale(.8); opacity: .65; }
.ieditor { border: 1px solid var(--line); border-radius: 10px; padding: 8px; display: grid; gap: 6px; background: var(--ink); }

/* ---------- som ---------- */
#bSound.alert { animation: pulse 1.2s infinite; border-color: var(--blood); }
@keyframes pulse { 50% { box-shadow: 0 0 0 4px #c0503f55; } }
#sndpop { position: fixed; top: 48px; right: 70px; z-index: 56; width: 270px; display: grid; gap: 10px; padding: 12px; background: #131723f5; border: 1px solid var(--line2); border-radius: 12px; box-shadow: 0 14px 50px #000c; }
.sndnow { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.trklist { display: grid; gap: 4px; max-height: 26vh; overflow: auto; }
.trk { display: flex; gap: 6px; align-items: center; padding: 5px 8px; border: 1px solid var(--line); border-radius: 8px; background: var(--ink); }
.trk.on { border-color: var(--brass); }
.trk .sfill { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.btn.on { border-color: var(--brass); color: var(--brass); background: #2a2417; }

/* ---------- intervalo ---------- */
#blackout { position: absolute; inset: 0; z-index: 30; background: #000; color: #d8d2c0; display: grid; place-items: center; font: 600 clamp(22px, 4vw, 40px) var(--serif); text-align: center; padding: 30px; }
#blackout.gm { inset: auto 0 0 0; top: 0; height: 36px; background: #4a1f18e6; font: 600 13px system-ui; padding: 0; z-index: 7; pointer-events: none; }

#movemode { position: absolute; left: 12px; bottom: 12px; z-index: 6; background: #131723e8; border: 1px solid var(--line2); border-radius: 10px; padding: 7px 12px; font-size: 13px; }
#movemode:hover { border-color: var(--brass); color: var(--brass); }
