:root {
  --bg: #0d0908;
  --bg2: #130e0c;
  --panel: #18110f;
  --panel2: #1f1714;
  --line: #2c211c;
  --line2: #3a2b23;
  --text: #ece4d6;
  --muted: #a3968a;
  --dim: #6f6259;
  --gold: #d9b26a;
  --gold-hi: #f5dea0;
  --gold-lo: #a0703a;
  --ember: #e86028;
  --red: #d9534f;
  --green: #5fbf6e;
  --mention: rgba(217, 178, 106, .10);
  --radius: 10px;
  --serif: 'Cinzel', 'Times New Roman', serif;
  --sans: 'Inter', system-ui, -apple-system, 'Segoe UI', sans-serif;
}
* { box-sizing: border-box; }
html, body { height: 100%; margin: 0; }
body {
  background: var(--bg); color: var(--text); font: 15px/1.45 var(--sans);
  -webkit-font-smoothing: antialiased; overflow: hidden;
}
button { font: inherit; color: inherit; cursor: pointer; }
input, textarea, select { font: inherit; color: var(--text); }
[hidden] { display: none !important; }
a { color: var(--gold-hi); }

/* brasas no fundo (só login) */
#embers { position: fixed; inset: 0; pointer-events: none; z-index: 0;
  background:
    radial-gradient(1200px 600px at 50% 120%, rgba(232, 96, 40, .18), transparent 60%),
    radial-gradient(800px 400px at 50% -20%, rgba(217, 178, 106, .08), transparent 60%);
}
#embers i { position: absolute; bottom: -10px; width: 3px; height: 3px; border-radius: 50%;
  background: #f08a3c; box-shadow: 0 0 8px 2px rgba(240, 120, 50, .7); animation: rise linear infinite; opacity: 0; }
@keyframes rise { 0% { transform: translateY(0) translateX(0); opacity: 0; } 10% { opacity: .9; } 100% { transform: translateY(-110vh) translateX(40px); opacity: 0; } }
body.in-app #embers { display: none; }

/* ============ telas de entrada ============ */
.screen { position: relative; z-index: 1; height: 100%; display: grid; place-items: center; padding: 16px; overflow: auto; }
.login-card { width: min(400px, 100%); margin-top: 70px; background: linear-gradient(180deg, rgba(31, 23, 20, .92), rgba(19, 14, 12, .95));
  border: 1px solid var(--line2); border-radius: 14px; padding: 36px 32px 28px;
  box-shadow: 0 30px 80px rgba(0, 0, 0, .6), inset 0 1px 0 rgba(255, 255, 255, .03); }
.login-card.wide { width: min(640px, 100%); }
.brand { text-align: center; margin-bottom: 26px; }
.brand-logo { display: block; width: min(300px, 86%); height: auto; margin: -78px auto 4px;
  filter: drop-shadow(0 10px 24px rgba(0, 0, 0, .7)) drop-shadow(0 0 30px rgba(232, 96, 40, .22)); }
.brand-kicker { font: 600 12px/1 var(--sans); letter-spacing: .5em; color: var(--gold); }
.brand h1 { font: 700 22px/1.15 var(--serif); letter-spacing: .32em; text-transform: uppercase; margin: 4px 0 12px;
  background: linear-gradient(180deg, var(--gold-hi), var(--gold) 55%, var(--gold-lo)); -webkit-background-clip: text; background-clip: text; color: transparent; }
.brand-line { display: block; height: 1px; width: 160px; margin: 0 auto 14px;
  background: linear-gradient(90deg, transparent, var(--gold), transparent); }
.brand p { margin: 0; color: var(--muted); font-size: 14px; }
form label { display: block; font-size: 12px; font-weight: 600; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); margin-bottom: 14px; }
form input { display: block; width: 100%; margin-top: 6px; padding: 12px 14px; background: var(--bg);
  border: 1px solid var(--line2); border-radius: 8px; outline: none; font-size: 15px; letter-spacing: normal; text-transform: none; }
form input:focus { border-color: var(--gold); box-shadow: 0 0 0 3px rgba(217, 178, 106, .15); }
.form-error { min-height: 20px; color: #f08a7a; font-size: 13px; margin: 0 0 10px; }
.btn-gold { width: 100%; padding: 13px; border: 1px solid #b98b45; border-radius: 8px;
  background: linear-gradient(180deg, #e7c47f, #b98b45); color: #1a120c; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; }
.btn-gold:hover { filter: brightness(1.08); }
.btn-gold:disabled { opacity: .6; cursor: wait; }
.login-foot { margin: 18px 0 0; text-align: center; color: var(--dim); font-size: 12px; }

.pick-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 12px; }
.pick { display: flex; flex-direction: column; align-items: center; gap: 8px; padding: 18px 12px; background: var(--bg2);
  border: 1px solid var(--line2); border-radius: 12px; transition: .15s; }
.pick:hover, .pick:focus-visible { border-color: var(--gold); transform: translateY(-2px); outline: none; }
.pick b { font-size: 16px; }
.pick small { color: var(--muted); }

/* ============ avatar (iniciais da classe) ============ */
.av { flex: none; width: 40px; height: 40px; border-radius: 50%; display: grid; place-items: center;
  font: 700 13px/1 var(--serif); color: #1a120c; letter-spacing: .02em; position: relative;
  background: linear-gradient(160deg, var(--c1, #e7c47f), var(--c2, #a0703a)); box-shadow: inset 0 0 0 2px rgba(0, 0, 0, .25); }
.av.sm { width: 32px; height: 32px; font-size: 11px; }
.av .dot { position: absolute; right: -2px; bottom: -2px; width: 12px; height: 12px; border-radius: 50%;
  background: var(--dim); border: 3px solid var(--panel); }
.av .dot.on { background: var(--green); }
.cls-0 { --c1: #8fb4ff; --c2: #3d5fb0; }  /* Wizard */
.cls-1 { --c1: #ff9a7a; --c2: #a8432a; }  /* Knight */
.cls-2 { --c1: #9be89b; --c2: #3e8a4a; }  /* Elf */
.cls-3 { --c1: #d2a6ff; --c2: #6a3fa8; }  /* MG */
.cls-4 { --c1: #ffd36b; --c2: #a8782a; }  /* DL */
.cls-5 { --c1: #ff9ad6; --c2: #a33a7c; }  /* Summoner */
.cls-6 { --c1: #9ce6e6; --c2: #2e8a8a; }  /* RF */

/* ============ layout do app ============ */
#app { position: relative; z-index: 1; display: grid; grid-template-columns: 260px 1fr 250px; height: 100%; }
#app.no-members { grid-template-columns: 260px 1fr; }
#app.no-members #members { display: none; }
#side-backdrop { display: none; }
#side { background: linear-gradient(180deg, #1b1310 0, var(--panel) 220px); border-right: 1px solid var(--line); display: flex; flex-direction: column; min-height: 0; }
.side-head { position: relative; padding: 14px 14px 12px; text-align: center; border-bottom: 1px solid var(--line);
  background: radial-gradient(220px 120px at 50% 55%, rgba(232, 96, 40, .20), transparent 70%); }
.side-head::after { content: ''; position: absolute; left: 18%; right: 18%; bottom: -1px; height: 1px;
  background: linear-gradient(90deg, transparent, var(--gold), transparent); opacity: .7; }
.side-logo { display: block; width: 188px; max-width: 100%; height: auto; margin: 0 auto 4px;
  filter: drop-shadow(0 6px 14px rgba(0, 0, 0, .6)); }
.side-head strong { display: block; font: 700 11px/1 var(--serif); letter-spacing: .5em; text-indent: .5em; color: var(--gold); text-transform: uppercase; }
#channel-list { flex: 1; overflow-y: auto; padding: 10px 8px; }
.cat { display: flex; align-items: center; gap: 6px; margin: 16px 8px 6px; font-size: 11px; font-weight: 700; letter-spacing: .12em; color: var(--gold-lo); }
.cat:first-child { margin-top: 4px; }
.cat .grow { flex: 1; }
.cat button { background: none; border: 0; color: var(--dim); padding: 0 2px; font-size: 14px; line-height: 1; }
.cat button:hover { color: var(--gold); }
.ch { display: flex; align-items: center; gap: 8px; width: 100%; padding: 7px 10px; margin: 1px 0; border: 0; border-radius: 7px;
  background: none; color: var(--muted); text-align: left; font-weight: 500; }
.ch .h { color: var(--dim); font-weight: 400; font-size: 18px; line-height: 1; width: 14px; }
.ch .name { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ch:hover { background: var(--panel2); color: var(--text); }
.ch { position: relative; }
.ch.active { background: linear-gradient(90deg, rgba(217, 178, 106, .16), rgba(217, 178, 106, .04)); color: var(--gold-hi); }
.ch.active::before { content: ''; position: absolute; left: -8px; top: 6px; bottom: 6px; width: 3px; border-radius: 0 3px 3px 0;
  background: linear-gradient(180deg, var(--gold-hi), var(--ember)); box-shadow: 0 0 10px rgba(232, 96, 40, .6); }
.ch.active .h { color: var(--gold); }
.ch.unread { color: var(--text); font-weight: 700; }
.ch .lock { font-size: 11px; opacity: .6; }
.ch .badge { background: var(--ember); color: #fff; font-size: 11px; font-weight: 700; border-radius: 9px; padding: 1px 6px; }
.ch .edit { background: none; border: 0; color: var(--dim); padding: 0; }
@media (hover: hover) { .ch .edit { visibility: hidden; } .ch:hover .edit { visibility: visible; } }
.ch .edit:hover { color: var(--gold); }

.me { display: flex; align-items: center; gap: 10px; padding: 10px 12px; background: var(--bg2); border-top: 1px solid var(--line); }
.me .who { flex: 1; min-width: 0; }
.me .who b { display: block; font-size: 14px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.me .who small { color: var(--muted); font-size: 12px; }
.icon-btn { background: none; border: 0; color: var(--muted); font-size: 18px; width: 34px; height: 34px; border-radius: 8px; display: grid; place-items: center; }
.icon-btn:hover { background: var(--panel2); color: var(--gold); }

#main { display: flex; flex-direction: column; min-width: 0; min-height: 0; background: var(--bg2); }
.main-head { position: relative; display: flex; align-items: center; gap: 8px; height: 56px; padding: 0 16px; border-bottom: 1px solid var(--line);
  background: linear-gradient(180deg, #1a1210, var(--bg2)); box-shadow: 0 6px 18px rgba(0, 0, 0, .25); z-index: 2; }
.main-head h2 { font-family: var(--serif) !important; letter-spacing: .04em; color: var(--gold-hi); }
.main-head .hash { color: var(--dim); font-size: 22px; }
.main-head h2 { margin: 0; font-size: 16px; font-weight: 700; white-space: nowrap; }
#ch-topic { flex: 1; color: var(--muted); font-size: 13px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
  padding-left: 12px; margin-left: 4px; border-left: 1px solid var(--line2); }
#conn-bar { background: #5a2a16; color: #ffd9c2; text-align: center; font-size: 13px; padding: 4px; }

#messages { flex: 1; overflow-y: auto; padding: 16px 0 8px; overscroll-behavior: contain;
  background: radial-gradient(900px 500px at 50% 110%, rgba(232, 96, 40, .06), transparent 70%); }
.load-more { text-align: center; color: var(--dim); font-size: 12px; padding: 8px; }
.welcome { padding: 24px 20px 16px; border-bottom: 1px solid var(--line); margin-bottom: 8px; }
.welcome .big { width: 64px; height: 64px; border-radius: 50%; display: grid; place-items: center; background: var(--panel2);
  border: 1px solid var(--line2); font: 700 30px/1 var(--serif); color: var(--gold); margin-bottom: 12px; }
.welcome h3 { margin: 0 0 4px; font: 700 26px/1.2 var(--serif); color: var(--gold-hi); }
.welcome p { margin: 0; color: var(--muted); }
.day { display: flex; align-items: center; gap: 10px; margin: 16px 20px 8px; color: var(--dim); font-size: 12px; font-weight: 600; }
.day::before, .day::after { content: ''; flex: 1; height: 1px; background: var(--line); }

.msg { position: relative; display: flex; gap: 14px; padding: 3px 20px 3px 18px; border-left: 2px solid transparent; }
.msg.head { margin-top: 14px; }
.msg:hover { background: rgba(255, 255, 255, .025); }
.msg.mention { background: var(--mention); border-left-color: var(--gold); }
.msg.pending { opacity: .5; }
.msg .gut { width: 40px; flex: none; text-align: right; }
.msg .gut time { visibility: hidden; color: var(--dim); font-size: 10.5px; line-height: 22px; }
.msg:hover .gut time { visibility: visible; }
.msg .body { min-width: 0; flex: 1; }
.msg .meta { display: flex; align-items: baseline; gap: 8px; flex-wrap: wrap; }
.msg .author { font-weight: 700; background: none; border: 0; padding: 0; color: var(--text); }
.msg .author:hover { text-decoration: underline; }
.msg .meta time { color: var(--dim); font-size: 12px; }
.role-owner .author, .role-admin .author { color: var(--gold-hi); }
.role-mod .author { color: #8fc4ff; }
.tag { font-size: 10px; font-weight: 700; letter-spacing: .06em; padding: 1px 6px; border-radius: 4px; text-transform: uppercase; }
.tag.admin { background: rgba(217, 178, 106, .18); color: var(--gold-hi); }
.tag.mod { background: rgba(120, 170, 255, .16); color: #a9cdff; }
.tag.gm { background: rgba(232, 96, 40, .2); color: #ffb48a; }
.tag.vip { background: rgba(190, 140, 255, .16); color: #d5b8ff; }
.tag.gmaster { background: rgba(95, 191, 110, .15); color: #9fe0a9; }
.msg .text { white-space: pre-wrap; word-wrap: break-word; overflow-wrap: anywhere; }
.msg .text code { background: var(--panel2); border: 1px solid var(--line2); border-radius: 4px; padding: 1px 4px; font-size: 13px; }
.msg .text pre { background: var(--panel); border: 1px solid var(--line2); border-radius: 6px; padding: 8px 10px; margin: 4px 0; white-space: pre-wrap; font-size: 13px; }
.msg .text .ment { background: rgba(217, 178, 106, .18); color: var(--gold-hi); border-radius: 3px; padding: 0 2px; }
.msg .edited { color: var(--dim); font-size: 11px; margin-left: 4px; }
.msg .reply { display: flex; align-items: center; gap: 6px; font-size: 13px; color: var(--muted); margin: 0 0 2px; cursor: pointer; }
.msg .reply::before { content: ''; width: 22px; height: 10px; border: 2px solid var(--line2); border-right: 0; border-bottom: 0; border-radius: 6px 0 0 0; margin-left: -30px; margin-top: 8px; }
.msg .reply b { color: var(--text); }
.msg .reply span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.msg.flash { animation: flash 1.6s ease-out; }
@keyframes flash { 0%, 30% { background: rgba(217, 178, 106, .22); } 100% { background: transparent; } }
.msg .tools { position: absolute; right: 16px; top: -14px; display: none; background: var(--panel); border: 1px solid var(--line2); border-radius: 8px; padding: 2px; box-shadow: 0 6px 20px rgba(0, 0, 0, .4); }
.msg:hover .tools { display: flex; }
.msg .tools button { background: none; border: 0; color: var(--muted); padding: 4px 8px; border-radius: 6px; font-size: 13px; }
.msg .tools button:hover { background: var(--panel2); color: var(--gold); }
.msg .tools button.danger:hover { color: var(--red); }
.msg .edit-box textarea { width: 100%; background: var(--bg); border: 1px solid var(--gold); border-radius: 6px; padding: 8px; resize: vertical; min-height: 60px; }
.msg .edit-box small { color: var(--dim); }

#typing { height: 22px; padding: 0 20px; color: var(--muted); font-size: 12px; }
#composer { padding: 0 16px 14px; }
#reply-bar { display: flex; align-items: center; justify-content: space-between; background: var(--panel); border: 1px solid var(--line2);
  border-bottom: 0; border-radius: 10px 10px 0 0; padding: 4px 6px 4px 14px; font-size: 13px; color: var(--muted); }
#reply-bar b { color: var(--gold-hi); }
.composer-box { display: flex; align-items: flex-end; gap: 8px; background: var(--panel); border: 1px solid var(--line2); border-radius: 10px; padding: 6px 6px 6px 14px; }
#reply-bar:not([hidden]) + .composer-box { border-top-left-radius: 0; border-top-right-radius: 0; }
.composer-box:focus-within { border-color: var(--gold-lo); box-shadow: 0 0 0 3px rgba(217, 178, 106, .08), 0 8px 24px rgba(0, 0, 0, .3); }
#input { flex: 1; background: none; border: 0; outline: none; resize: none; max-height: 200px; padding: 8px 0; line-height: 1.4; }
#input:disabled { cursor: not-allowed; }
.btn-send { width: 38px; height: 38px; border-radius: 8px; border: 0; background: linear-gradient(180deg, #e7c47f, #b98b45); color: #1a120c; font-size: 16px; }
.btn-send:disabled { opacity: .35; cursor: not-allowed; }
#composer-hint { color: var(--dim); font-size: 11px; padding: 5px 4px 0; }

#members { background: linear-gradient(180deg, #1b1310 0, var(--panel) 220px); border-left: 1px solid var(--line); overflow-y: auto; padding: 12px 8px; }
.mgroup { margin: 14px 8px 6px; font-size: 11px; font-weight: 700; letter-spacing: .12em; color: var(--gold-lo); }
.mgroup:first-child { margin-top: 4px; }
.member { display: flex; align-items: center; gap: 10px; width: 100%; padding: 6px 8px; border: 0; border-radius: 8px; background: none; text-align: left; }
.member:hover { background: var(--panel2); }
.member.off { opacity: .45; }
.member .who { min-width: 0; flex: 1; }
.member .who b { display: block; font-size: 14px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.member .who small { display: block; color: var(--muted); font-size: 11.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.member.role-owner b, .member.role-admin b { color: var(--gold-hi); }
.member.role-mod b { color: #a9cdff; }
.member .muted { font-size: 11px; }

/* ============ popup / modal ============ */
#overlay { position: fixed; inset: 0; background: rgba(0, 0, 0, .55); z-index: 50; }
#modal { position: fixed; z-index: 60; left: 50%; top: 50%; transform: translate(-50%, -50%); width: min(460px, calc(100% - 32px));
  max-height: calc(100% - 32px); overflow: auto; background: var(--panel); border: 1px solid var(--line2); border-radius: 14px; padding: 22px; box-shadow: 0 30px 80px rgba(0, 0, 0, .6); }
#modal h3 { margin: 0 0 16px; font: 700 20px/1.2 var(--serif); color: var(--gold-hi); }
#modal label { display: block; font-size: 12px; font-weight: 600; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); margin: 12px 0 6px; }
#modal input, #modal select, #modal textarea { width: 100%; padding: 10px 12px; background: var(--bg); border: 1px solid var(--line2); border-radius: 8px; outline: none; text-transform: none; letter-spacing: normal; }
#modal input:focus, #modal select:focus, #modal textarea:focus { border-color: var(--gold); }
#modal .row { display: flex; gap: 10px; }
#modal .row > * { flex: 1; }
#modal .actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 20px; flex-wrap: wrap; }
.btn { padding: 9px 16px; border-radius: 8px; border: 1px solid var(--line2); background: var(--panel2); font-weight: 600; }
.btn:hover { border-color: var(--gold-lo); }
.btn.primary { background: linear-gradient(180deg, #e7c47f, #b98b45); color: #1a120c; border-color: #b98b45; }
.btn.danger { background: #4a1c1a; border-color: #7a2d28; color: #ffc9c3; }
.btn.danger:hover { background: #5c221f; }
.list { display: flex; flex-direction: column; gap: 6px; max-height: 50vh; overflow: auto; }
.list .item { display: flex; align-items: center; gap: 10px; padding: 8px 10px; background: var(--bg2); border: 1px solid var(--line); border-radius: 8px; font-size: 13px; }
.list .item .grow { flex: 1; min-width: 0; }
.list .item small { color: var(--muted); display: block; }

#popup { position: fixed; z-index: 55; width: 290px; background: var(--panel); border: 1px solid var(--line2); border-radius: 14px; overflow: hidden; box-shadow: 0 20px 60px rgba(0, 0, 0, .6); }
.pop-banner { height: 56px; background: linear-gradient(120deg, #3a2414, #1c1310 60%, #3a1a10); }
.pop-body { padding: 0 16px 16px; margin-top: -28px; }
.pop-body .av { width: 64px; height: 64px; font-size: 20px; border: 4px solid var(--panel); }
.pop-body h4 { margin: 8px 0 2px; font-size: 18px; }
.pop-body .tags { display: flex; flex-wrap: wrap; gap: 4px; margin: 6px 0 10px; }
.pop-body .info { color: var(--muted); font-size: 13px; }
.pop-body .mod { border-top: 1px solid var(--line); margin-top: 12px; padding-top: 10px; display: flex; flex-wrap: wrap; gap: 6px; }
.pop-body .mod .btn { padding: 6px 10px; font-size: 12.5px; }

#toast { position: fixed; z-index: 70; left: 50%; bottom: 90px; transform: translateX(-50%); background: var(--panel2); border: 1px solid var(--gold-lo);
  color: var(--text); padding: 10px 16px; border-radius: 10px; font-size: 14px; box-shadow: 0 10px 30px rgba(0, 0, 0, .5); max-width: calc(100% - 32px); }
#toast.err { border-color: #7a2d28; }

.only-mobile { display: none; }
::-webkit-scrollbar { width: 10px; }
::-webkit-scrollbar-thumb { background: #2e231d; border-radius: 10px; border: 3px solid transparent; background-clip: content-box; }
::-webkit-scrollbar-track { background: transparent; }

@media (max-width: 1000px) {
  #app, #app.no-members { grid-template-columns: 240px 1fr; }
  #members { position: fixed; right: 0; top: 0; bottom: 0; width: 260px; z-index: 40; box-shadow: -20px 0 60px rgba(0, 0, 0, .5); }
  #app.no-members #members { display: none; }
}
@media (max-width: 720px) {
  .brand-logo { margin-top: -60px; }
  #app, #app.no-members { grid-template-columns: 1fr; }
  #side { position: fixed; left: 0; top: 0; bottom: 0; width: 280px; z-index: 52; transform: translateX(-100%); transition: transform .2s; box-shadow: 20px 0 60px rgba(0, 0, 0, .5); }
  #app.side-open #side { transform: none; }
  #side-backdrop { position: fixed; inset: 0; z-index: 51; background: rgba(0, 0, 0, .55); }
  #app.side-open #side-backdrop { display: block; }
  .only-mobile { display: grid; }
  #ch-topic { display: none; }
  .main-head h2 { flex: 1; }
  .msg { padding-left: 10px; padding-right: 12px; gap: 10px; }
  .msg .gut { width: 32px; }
  .msg .av { width: 32px; height: 32px; font-size: 11px; }
  #composer-hint { display: none; }
  #composer { padding: 0 10px 10px; padding-bottom: max(10px, env(safe-area-inset-bottom)); }
}

/* ============ voz e tela ============ */
.ch.voice .vi { display: grid; place-items: center; }
.ch.voice .vi svg { width: 16px; height: 16px; fill: currentColor; }
.ch .vcount { font-size: 11px; color: var(--dim); }
.vmember { display: flex; align-items: center; gap: 8px; padding: 3px 10px 3px 32px; font-size: 13px; color: var(--muted); }
.vmember .av.xs { width: 24px; height: 24px; font-size: 8.5px; cursor: pointer; transition: box-shadow .12s; }
.vmember.speaking .av { box-shadow: 0 0 0 2px var(--bg2), 0 0 0 4px var(--green); }
.vmember.speaking .vname { color: var(--text); }
.vmember .vname { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.vmember .vname small { color: var(--dim); }
.vmember .vic svg { width: 14px; height: 14px; fill: currentColor; display: block; }
.vmember .vic.off { color: var(--red); }
.live { border: 0; background: var(--red); color: #fff; font-size: 9.5px; font-weight: 800; letter-spacing: .06em; padding: 2px 5px; border-radius: 4px; }
button.live:hover { filter: brightness(1.15); }

#voice-bar { border-top: 1px solid var(--line); background: var(--bg2); padding: 10px 12px 8px; }
.vb-top { display: flex; align-items: center; gap: 8px; }
.vb-info { flex: 1; min-width: 0; }
.vb-info small { display: block; color: var(--muted); font-size: 12px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.vs { font-size: 13px; font-weight: 700; }
.vs.ok { color: var(--green); }
.vs.wait { color: var(--gold); }
.vs.bad { color: var(--red); }
.vb-row { display: flex; gap: 6px; margin-top: 8px; }
.vbtn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; height: 32px; min-width: 36px; padding: 0 8px; border-radius: 8px;
  border: 1px solid var(--line2); background: var(--panel2); color: var(--text); font-size: 12.5px; font-weight: 600; }
.vbtn svg { width: 18px; height: 18px; fill: currentColor; flex: none; }
.vbtn:hover { border-color: var(--gold-lo); color: var(--gold-hi); }
.vbtn.wide { flex: 1; }
.vbtn.on-bad { background: #4a1c1a; border-color: #7a2d28; color: #ffc9c3; }
.vbtn.on-good { background: #1d3a22; border-color: #2f6b3a; color: #b6f0c0; }
.vbtn.danger { background: #4a1c1a; border-color: #7a2d28; color: #ffc9c3; }
.vbtn.danger:hover { background: #5c221f; color: #fff; }

#main { position: relative; }
#stage { position: absolute; inset: 56px 0 0 0; z-index: 30; display: flex; flex-direction: column; background: #050403; }
.stage-head { display: flex; align-items: center; gap: 10px; padding: 8px 12px; border-bottom: 1px solid var(--line); background: var(--bg2); }
.stage-head .grow { flex: 1; }
.stage-body { flex: 1; min-height: 0; position: relative; display: grid; place-items: center; background: #000; }
.stage-body video { width: 100%; height: 100%; object-fit: contain; background: #000; }
#stage-wait { position: absolute; color: var(--muted); }

/* ============ market: item postado no jogo ============ */
.item-card { display: inline-block; margin: 4px 0 2px; max-width: 340px; width: 100%; border: 1px solid #3b2c22; border-radius: 10px; overflow: hidden;
  background: linear-gradient(180deg, #1d1512, #120d0b); box-shadow: 0 8px 24px rgba(0, 0, 0, .35); }
.ic-head { display: flex; align-items: center; gap: 10px; padding: 10px 12px; border-bottom: 1px solid #2e221b;
  background: radial-gradient(160px 60px at 0 50%, rgba(232, 96, 40, .14), transparent 70%); }
.ic-ico { width: 38px; height: 38px; flex: none; display: grid; place-items: center; font-size: 20px; border-radius: 8px;
  background: #0b0807; border: 1px solid #4a3627; box-shadow: inset 0 0 12px rgba(0, 0, 0, .8); }
.ic-title { min-width: 0; }
.ic-title b { display: block; font-size: 14.5px; line-height: 1.25; }
.ic-title small { color: var(--dim); font-size: 11.5px; }
.ic-tip { padding: 10px 14px 12px; text-align: center; font: 12.5px/1.55 Tahoma, Verdana, var(--sans); background: rgba(0, 0, 0, .55); }
.ic-tip .ic-name { font-weight: 700; font-size: 13.5px; margin-bottom: 4px; }
.ic-foot { display: flex; gap: 8px; padding: 8px 10px; border-top: 1px solid #2e221b; background: #140f0c; }
.ic-btn { flex: 1; padding: 8px 10px; border-radius: 8px; border: 1px solid #b98b45; font-weight: 700; font-size: 13px; color: #1a120c;
  background: linear-gradient(180deg, #e7c47f, #b98b45); }
.ic-btn:hover { filter: brightness(1.08); }
.ic-btn:disabled { background: #1d3a22; border-color: #2f6b3a; color: #b6f0c0; cursor: default; filter: none; }
.item-card { position: relative; }
.ic-head { position: relative; }
.ic-price { margin-left: auto; flex: none; max-width: 40%; padding: 4px 9px; border-radius: 7px; font-weight: 800; font-size: 13px;
  color: #1a120c; background: linear-gradient(180deg, #ffe08a, #d4a24c); box-shadow: 0 0 12px rgba(255, 210, 100, .25);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ic-btn.ghost { background: var(--panel2); color: var(--text); border-color: var(--line2); font-weight: 600; }
.ic-btn.ghost:hover { border-color: var(--gold-lo); color: var(--gold-hi); }
.ic-btn.sold { background: #1d3a22; border-color: #2f6b3a; color: #b6f0c0; }
.item-card.sold .ic-tip, .item-card.sold .ic-head { opacity: .45; filter: grayscale(.6); }
.ic-stamp { position: absolute; top: 44%; left: 50%; transform: translate(-50%, -50%) rotate(-14deg); padding: 4px 18px; border: 3px solid #e2483d;
  border-radius: 8px; color: #ff6b5e; font: 900 26px/1.1 var(--serif); letter-spacing: .12em; background: rgba(20, 8, 6, .75);
  box-shadow: 0 0 24px rgba(226, 72, 61, .35); pointer-events: none; }

/* ============ avisos / embeds (formato do Discord) ============ */
.text.rich { white-space: pre-wrap; }
.md-h1, .md-h2, .md-h3 { display: block; font-weight: 800; line-height: 1.3; margin: 6px 0 2px; color: var(--text); }
.md-h1 { font-size: 22px; } .md-h2 { font-size: 18px; } .md-h3 { font-size: 16px; }
.md-sub { display: block; font-size: 12px; color: var(--dim); }
.md-quote { display: block; border-left: 4px solid var(--line2); padding-left: 10px; color: var(--muted); }
.md-li { display: block; padding-left: 16px; position: relative; }
.md-li::before { content: '•'; position: absolute; left: 4px; color: var(--muted); }
.md-spoiler { background: #2a201b; color: transparent; border-radius: 3px; cursor: pointer; }
.md-spoiler:hover { color: inherit; }
.embed { display: flex; gap: 14px; max-width: 560px; margin: 6px 0 2px; padding: 10px 14px 12px 12px; border-left: 4px solid var(--gold-lo);
  border-radius: 6px; background: #1b1411; box-shadow: 0 4px 16px rgba(0, 0, 0, .25); }
.em-main { min-width: 0; flex: 1; white-space: pre-wrap; word-wrap: break-word; }
.em-author { display: flex; align-items: center; gap: 8px; font-size: 13px; font-weight: 600; margin-bottom: 6px; }
.em-author img, .em-footer img { width: 22px; height: 22px; border-radius: 50%; object-fit: cover; }
.em-author a { color: var(--text); text-decoration: none; }
.em-title { font-weight: 800; font-size: 15.5px; margin-bottom: 6px; color: var(--text); }
.em-title a { color: #6cb6ff; text-decoration: none; }
.em-desc { font-size: 14px; line-height: 1.45; color: #ddd3c6; }
.em-fields { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px 14px; margin-top: 10px; }
.em-field { grid-column: 1 / -1; font-size: 14px; }
.em-field.inline { grid-column: auto; }
.em-fname { font-weight: 800; margin-bottom: 2px; color: var(--text); }
.em-fvalue { color: #ddd3c6; line-height: 1.45; }
.em-image img { display: block; max-width: 100%; max-height: 360px; border-radius: 6px; margin-top: 12px; }
.em-thumb img { width: 80px; height: 80px; object-fit: cover; border-radius: 6px; }
.em-footer { display: flex; align-items: center; gap: 8px; margin-top: 10px; font-size: 12px; color: var(--muted); }
#btn-embed { flex: none; align-self: flex-end; }
#modal.wide { width: min(760px, calc(100% - 32px)); }
.em-preview { max-height: 45vh; overflow: auto; margin-top: 8px; }
.em-preview:empty { display: none; }
@media (max-width: 720px) { .em-fields { grid-template-columns: 1fr; } .embed { max-width: 100%; } }
.ic-who { padding: 8px 12px; border-top: 1px solid #2e221b; font-size: 12.5px; color: var(--muted); background: #17110e; }
.ic-who b { color: var(--gold-hi); }
