/* ───────────── Tema: fantasia sombria (vidro escuro + ouro + verde-azulado) ───────────── */
:root {
  --bg: #090d10; --surface: rgba(17, 25, 29, .82); --elev: #19242a; --elev-2: #20303a; --border: rgba(255, 255, 255, .08); --border-2: #2c3d44;
  --text: #e9efee; --muted: #8b9fa3;
  --gold: #d9aa4c; --gold-2: #f2d08a; --gold-dim: rgba(217, 170, 76, .35);
  --teal: #3fb8a5; --purple: #8a6cf0;
  --ok: #3ecf8e; --warn: #f5b942; --bad: #ef5b5b; --radius: 14px;
  --shadow: 0 14px 40px rgba(0, 0, 0, .45);
  --serif: 'Cinzel', Georgia, serif;
}
* { box-sizing: border-box; }
html, body { margin: 0; color: var(--text); font: 15px/1.45 Inter, system-ui, sans-serif; -webkit-font-smoothing: antialiased; }
body {
  min-height: 100vh; background-color: var(--bg);
  background-image:
    radial-gradient(900px 600px at 8% -10%, rgba(63, 184, 165, .13), transparent 60%),
    radial-gradient(800px 600px at 100% 110%, rgba(138, 108, 240, .12), transparent 60%),
    repeating-linear-gradient(45deg, rgba(255, 255, 255, .012) 0 2px, transparent 2px 6px);
  background-attachment: fixed;
}
h1, h2, h3, h4, p { margin: 0; }
h1, h2, h3 { font-family: var(--serif); letter-spacing: .02em; }
button, input, select, textarea { font: inherit; color: inherit; }
code { background: rgba(217, 170, 76, .12); padding: 1px 7px; border-radius: 6px; font-size: .85em; color: var(--gold-2); }
small { color: var(--muted); font-size: .8rem; }
.muted { color: var(--muted); } .center { text-align: center; } .grow { flex: 1; min-width: 0; }
.splash { display: grid; place-items: center; min-height: 100vh; color: var(--muted); font-family: var(--serif); }
::-webkit-scrollbar { width: 10px; height: 10px; } ::-webkit-scrollbar-thumb { background: #26353b; border-radius: 99px; border: 2px solid transparent; background-clip: padding-box; }

/* Botões */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; padding: 9px 15px; border-radius: 10px; border: 1px solid var(--border-2); background: var(--elev); cursor: pointer; font-weight: 500; transition: .15s; white-space: nowrap; }
.btn:hover:not(:disabled) { border-color: var(--gold-dim); background: var(--elev-2); }
.btn:disabled { opacity: .45; cursor: not-allowed; }
.btn.primary, .btn.gold { background: linear-gradient(180deg, #e6bb5f, #c4912f); border-color: #e9c372; color: #1d1608; font-weight: 600; box-shadow: 0 1px 0 rgba(255, 255, 255, .35) inset, 0 6px 16px rgba(217, 170, 76, .18); }
.btn.primary:hover:not(:disabled), .btn.gold:hover:not(:disabled) { background: linear-gradient(180deg, #f0c76c, #d19c36); border-color: #f2d08a; }
.btn.danger { color: var(--bad); border-color: #5a2d35; background: transparent; }
.btn.danger.solid { background: var(--bad); border-color: var(--bad); color: #fff; }
.btn.ghost { background: transparent; border-color: transparent; color: var(--muted); }
.btn.ghost:hover:not(:disabled) { color: var(--text); background: var(--elev); }
.btn.sm { padding: 6px 10px; font-size: .85rem; border-radius: 8px; }
.btn.block { width: 100%; }
.icon-btn { display: inline-grid; place-items: center; width: 36px; height: 36px; border-radius: 10px; border: 1px solid transparent; background: transparent; color: var(--muted); cursor: pointer; }
.icon-btn:hover { background: var(--elev); color: var(--gold-2); }
.icon-btn.sm { width: 30px; height: 30px; border-radius: 8px; border-color: var(--border-2); }
.link { background: none; border: 0; color: var(--gold-2); cursor: pointer; padding: 0; font-size: .8rem; }
.link:hover { text-decoration: underline; }

/* Formulários */
label { display: flex; flex-direction: column; gap: 6px; font-size: .78rem; color: var(--muted); font-weight: 600; text-transform: uppercase; letter-spacing: .06em; }
input, select, textarea { background: rgba(0, 0, 0, .28); border: 1px solid var(--border-2); border-radius: 10px; padding: 10px 12px; width: 100%; outline: none; transition: .15s; text-transform: none; letter-spacing: 0; font-weight: 400; font-size: .95rem; }
input:focus, select:focus, textarea:focus { border-color: var(--gold); box-shadow: 0 0 0 3px rgba(217, 170, 76, .16); }
input.num { width: 84px; flex: none; } input.emoji { text-align: center; font-size: 1.3rem; }
.form { display: flex; flex-direction: column; gap: 14px; }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; } .grid2.narrow { grid-template-columns: 90px 1fr; }
.inline { display: flex; gap: 8px; align-items: center; }
.check { flex-direction: row; align-items: center; gap: 10px; color: var(--text); font-weight: 400; cursor: pointer; text-transform: none; letter-spacing: 0; font-size: .9rem; }
.check input { width: 18px; height: 18px; accent-color: var(--gold); flex: none; } .check.strong { font-weight: 600; }
.sep { height: 1px; background: linear-gradient(90deg, transparent, var(--gold-dim), transparent); margin: 4px 0; }
.alert { background: rgba(239, 91, 91, .12); border: 1px solid #5a2d35; color: #ffb4b4; padding: 10px 12px; border-radius: 10px; font-size: .88rem; }
.seg { display: flex; background: rgba(0, 0, 0, .3); border: 1px solid var(--border-2); border-radius: 12px; padding: 4px; gap: 4px; }
.seg button { flex: 1; border: 0; background: transparent; color: var(--muted); padding: 8px; border-radius: 9px; cursor: pointer; font-weight: 500; }
.seg button.on { background: var(--elev-2); color: var(--gold-2); box-shadow: 0 0 0 1px var(--gold-dim) inset; }

/* Login */
.auth { min-height: 100vh; display: grid; place-items: center; padding: 20px; }
.auth-card { width: 100%; max-width: 400px; background: var(--surface); backdrop-filter: blur(14px); border: 1px solid var(--border); border-radius: 20px; padding: 30px; display: flex; flex-direction: column; gap: 14px; box-shadow: var(--shadow), 0 0 0 1px rgba(217, 170, 76, .08) inset; position: relative; }
.auth-card::before { content: ''; position: absolute; left: 24px; right: 24px; top: -1px; height: 2px; background: linear-gradient(90deg, transparent, var(--gold), transparent); }
.auth-card.wide { max-width: 520px; }
.auth-card h1 { font-size: 1.7rem; color: var(--gold-2); }
.logo { width: 54px; height: 54px; display: grid; place-items: center; font-size: 26px; border-radius: 50%; background: radial-gradient(circle at 30% 25%, #2b3a42, #121a1e); border: 2px solid var(--gold); box-shadow: 0 0 22px rgba(217, 170, 76, .25); }
.list { display: flex; flex-direction: column; gap: 8px; }
.row-btn { display: flex; justify-content: space-between; align-items: center; padding: 14px; border-radius: 12px; border: 1px solid var(--border-2); background: var(--elev); cursor: pointer; text-align: left; }
.row-btn:hover { border-color: var(--gold); }

/* ───────────── Estrutura: barra lateral + conteúdo ───────────── */
.shell { display: flex; min-height: 100vh; }
.rail { position: sticky; top: 0; height: 100vh; width: 82px; flex: none; display: flex; flex-direction: column; align-items: center; justify-content: space-between; padding: 14px 0; background: linear-gradient(180deg, #0b1013, #080b0d); border-right: 1px solid var(--border); z-index: 25; }
.rail-logo { width: 46px; height: 46px; display: grid; place-items: center; border-radius: 50%; border: 2px solid var(--gold); font-size: 20px; color: var(--gold-2); margin-bottom: 10px; background: radial-gradient(circle at 30% 25%, #2b3a42, #121a1e); box-shadow: 0 0 18px rgba(217, 170, 76, .2); }
.rail-group { display: flex; flex-direction: column; gap: 10px; align-items: center; } .rail > .rail-group:nth-of-type(1) { margin-bottom: auto; margin-top: 6px; }
.rail-btn { background: none; border: 0; cursor: pointer; display: flex; flex-direction: column; align-items: center; gap: 5px; color: var(--muted); width: 74px; padding: 2px 0; }
.rail-btn em { font-style: normal; font-size: .66rem; font-weight: 600; letter-spacing: .05em; text-transform: uppercase; }
.rail-ico { width: 46px; height: 46px; display: grid; place-items: center; border-radius: 50%; border: 1px solid var(--border-2); background: rgba(255, 255, 255, .02); transition: .18s; }
.rail-btn:hover .rail-ico { border-color: var(--gold-dim); color: var(--gold-2); transform: translateY(-1px); }
.rail-btn.on { color: var(--gold-2); }
.rail-btn.on .rail-ico { border: 2px solid var(--gold); background: radial-gradient(circle at 30% 25%, rgba(217, 170, 76, .22), rgba(217, 170, 76, .04)); box-shadow: 0 0 16px rgba(217, 170, 76, .28); color: var(--gold-2); }
.content { flex: 1; min-width: 0; padding-bottom: 110px; }
.top { position: sticky; top: 0; z-index: 20; display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 12px 24px; background: rgba(9, 13, 16, .8); backdrop-filter: blur(14px); border-bottom: 1px solid var(--border); }
.top::after { content: ''; position: absolute; left: 0; right: 0; bottom: -1px; height: 1px; background: linear-gradient(90deg, var(--gold-dim), transparent 40%); }
.top-l, .top-r { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; } .top-l small { display: block; }
.title { font-size: 1.25rem; color: var(--gold-2); line-height: 1.2; }
.chip-s { display: inline-flex; align-items: center; gap: 7px; padding: 6px 13px; border-radius: 999px; background: rgba(255, 255, 255, .03); border: 1px solid var(--border-2); font-size: .82rem; color: var(--text); }
.chip-s i { font-style: normal; color: var(--muted); font-size: .74rem; text-transform: uppercase; letter-spacing: .06em; }
.master-main, .player-grid { max-width: 1320px; margin: 0 auto; padding: 22px 24px; }
.master-main { display: flex; flex-direction: column; gap: 20px; }
.section-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.section-head h2 { font-size: 1.1rem; color: var(--gold-2); display: flex; align-items: center; gap: 12px; }
.section-head h2::after { content: ''; width: 60px; height: 1px; background: linear-gradient(90deg, var(--gold-dim), transparent); }
.empty { grid-column: 1 / -1; padding: 30px; text-align: center; color: var(--muted); border: 1px dashed var(--border-2); border-radius: var(--radius); }

/* Painéis em "janela" */
.panel { position: relative; background: var(--surface); backdrop-filter: blur(10px); border: 1px solid var(--border); border-radius: var(--radius); padding: 16px; display: flex; flex-direction: column; gap: 12px; box-shadow: 0 10px 30px rgba(0, 0, 0, .25), 0 1px 0 rgba(255, 255, 255, .04) inset; }
.panel h4 { display: flex; align-items: center; gap: 9px; font: 600 .82rem var(--serif); text-transform: uppercase; letter-spacing: .12em; color: var(--gold-2); padding-bottom: 10px; border-bottom: 1px solid var(--border); margin: -2px 0 0; }
.panel h4::before { content: ''; width: 6px; height: 6px; transform: rotate(45deg); background: var(--gold); flex: none; }

/* Mesa (cenário + NPC) com moldura */
.stage { position: relative; aspect-ratio: 21 / 9; min-height: 230px; max-height: 46vh; width: 100%; border-radius: 18px; overflow: hidden; border: 1px solid var(--gold-dim); background: linear-gradient(135deg, #17222a, #0d1318) center / cover no-repeat; display: flex; align-items: flex-end; justify-content: center; box-shadow: var(--shadow), 0 0 0 4px rgba(0, 0, 0, .25); }
.stage::before, .stage::after { content: ''; position: absolute; width: 26px; height: 26px; border: 2px solid var(--gold); z-index: 3; pointer-events: none; }
.stage::before { left: 10px; top: 10px; border-right: 0; border-bottom: 0; border-top-left-radius: 8px; }
.stage::after { right: 10px; bottom: 10px; border-left: 0; border-top: 0; border-bottom-right-radius: 8px; }
.stage-shade { position: absolute; inset: 0; background: radial-gradient(ellipse at center, transparent 40%, rgba(0, 0, 0, .55)), linear-gradient(to top, rgba(0, 0, 0, .6), transparent 55%); }
.stage-scene { position: absolute; left: 22px; top: 18px; padding: 6px 16px; background: rgba(8, 12, 14, .65); backdrop-filter: blur(8px); border: 1px solid var(--gold-dim); border-radius: 999px; font: 600 .78rem var(--serif); letter-spacing: .08em; color: var(--gold-2); text-transform: uppercase; z-index: 2; }
.stage-npc { position: relative; z-index: 2; margin: 0; height: 94%; display: flex; flex-direction: column; align-items: center; justify-content: flex-end; animation: rise .4s ease; }
.stage-npc img { max-height: calc(100% - 38px); max-width: 80vw; object-fit: contain; filter: drop-shadow(0 10px 22px rgba(0, 0, 0, .7)); }
.stage-npc figcaption { margin-top: 8px; padding: 6px 20px; background: linear-gradient(180deg, rgba(40, 30, 14, .9), rgba(14, 10, 4, .9)); border: 1px solid var(--gold); border-radius: 8px; font: 600 .95rem var(--serif); letter-spacing: .06em; color: var(--gold-2); box-shadow: 0 6px 16px rgba(0, 0, 0, .5); }
.stage-empty { position: absolute; inset: 0; display: grid; place-items: center; color: var(--muted); text-align: center; padding: 20px; font-family: var(--serif); letter-spacing: .04em; }
@keyframes rise { from { opacity: 0; transform: translateY(12px); } }

.pickers { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.picker { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 12px; min-width: 0; }
.picker-h { display: flex; justify-content: space-between; margin-bottom: 8px; } .picker-h b { font: 600 .78rem var(--serif); letter-spacing: .1em; text-transform: uppercase; color: var(--gold-2); }
.picker-row { display: flex; gap: 8px; overflow-x: auto; padding-bottom: 4px; }
.thumb { flex: none; width: 88px; border: 2px solid transparent; background: var(--elev); border-radius: 10px; padding: 0; cursor: pointer; overflow: hidden; text-align: center; transition: .15s; }
.thumb img { width: 100%; height: 62px; object-fit: cover; display: block; }
.thumb span { display: block; font-size: .7rem; padding: 3px 4px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.thumb.on { border-color: var(--gold); box-shadow: 0 0 14px rgba(217, 170, 76, .3); } .thumb:hover { border-color: var(--gold-dim); } .thumb.on:hover { border-color: var(--gold); }

/* Cards de jogador (mestre) */
.cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 16px; }
.card { background: var(--surface); border: 1px solid var(--border); border-radius: 16px; overflow: hidden; display: flex; flex-direction: column; transition: .2s; box-shadow: 0 10px 28px rgba(0, 0, 0, .3); }
.card:hover { border-color: var(--gold-dim); transform: translateY(-2px); }
.card.talking, .voice-p.talking .avatar, .mate.talking .avatar { box-shadow: 0 0 0 3px var(--teal), 0 0 18px rgba(63, 184, 165, .5); }
.card.talking { border-color: var(--teal); }
.card-img { position: relative; border: 0; padding: 0; cursor: pointer; aspect-ratio: 4 / 4.4; background: var(--elev); display: grid; place-items: center; font: 700 3.4rem var(--serif); color: var(--muted); overflow: hidden; }
.card-img img { width: 100%; height: 100%; object-fit: cover; transition: transform .35s; } .card-img:hover img { transform: scale(1.05); }
.card-img::after { content: ''; position: absolute; inset: 0; background: linear-gradient(to top, rgba(6, 9, 11, .92), transparent 52%); pointer-events: none; }
.card-cap { position: absolute; left: 14px; right: 14px; bottom: 11px; z-index: 2; text-align: left; display: flex; flex-direction: column; }
.card-cap b { font: 700 1.1rem var(--serif); letter-spacing: .03em; color: #fff; text-shadow: 0 2px 6px #000; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.card-cap small { color: #aab9bc; }
.card-img .dot { position: absolute; top: 12px; left: 12px; z-index: 2; }
.card-img .bag { position: absolute; z-index: 2; right: 12px; top: 10px; display: inline-flex; gap: 5px; align-items: center; font-style: normal; font: 600 .76rem Inter; padding: 4px 10px; border-radius: 999px; background: rgba(8, 12, 14, .7); border: 1px solid var(--gold-dim); backdrop-filter: blur(6px); color: var(--gold-2); }
.card-body { padding: 12px 14px 14px; display: flex; flex-direction: column; gap: 11px; }
.hp-ctrl { display: flex; align-items: center; gap: 8px; } .hp-mid { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 6px; }
.hp-in { padding: 4px 8px; text-align: center; font-size: .85rem; border-radius: 8px; }

.dot { width: 10px; height: 10px; border-radius: 50%; background: #4b5a60; border: 2px solid #0c1114; display: inline-block; flex: none; }
.dot.on { background: var(--ok); box-shadow: 0 0 9px var(--ok); }

/* HP (coração), atributos (escudos), condições */
.hp-row { display: flex; align-items: center; gap: 8px; } .hp-heart { display: grid; flex: none; filter: drop-shadow(0 0 6px currentColor); }
.hp-track { flex: 1; height: 8px; background: rgba(0, 0, 0, .5); border-radius: 99px; overflow: hidden; border: 1px solid var(--border-2); } .hp.big .hp-track { height: 13px; }
.hp-fill { height: 100%; border-radius: 99px; transition: width .4s ease, background .3s; box-shadow: 0 0 10px currentColor inset; }
.hp-num { font-size: .78rem; color: var(--muted); min-width: 46px; text-align: right; font-variant-numeric: tabular-nums; } .hp-num b { color: var(--text); font-size: 1.05em; } .hp.big .hp-num { font-size: .95rem; }
.attrs { display: flex; flex-wrap: wrap; gap: 8px 10px; }
.attr { display: flex; flex-direction: column; align-items: center; gap: 4px; width: 58px; }
.attr b { position: relative; isolation: isolate; width: 46px; height: 52px; display: grid; place-items: center; padding-bottom: 5px; font: 700 1.15rem var(--serif); color: var(--gold-2); clip-path: polygon(0 0, 100% 0, 100% 68%, 50% 100%, 0 68%); background: linear-gradient(180deg, var(--gold), #8c6420); }
.attr b::before { content: ''; position: absolute; inset: 1.5px; z-index: -1; clip-path: polygon(0 0, 100% 0, 100% 68%, 50% 100%, 0 68%); background: linear-gradient(180deg, #1c2a30, #0f171b); }
.attr span { font-size: .62rem; color: var(--muted); text-transform: uppercase; letter-spacing: .05em; max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; text-align: center; }
.conds { display: flex; flex-wrap: wrap; gap: 5px; }
.cond { font-size: .72rem; padding: 2px 10px; border-radius: 6px; background: rgba(245, 185, 66, .1); color: var(--warn); border: 1px solid rgba(245, 185, 66, .3); display: inline-flex; align-items: center; gap: 4px; }
button.cond { cursor: pointer; }

/* Avatar */
.avatar { border-radius: 50%; background: linear-gradient(135deg, #2a3a42, #1b262c); display: grid; place-items: center; font: 700 1em var(--serif); color: var(--gold-2); overflow: hidden; flex: none; transition: box-shadow .15s; border: 1px solid var(--border-2); }
.avatar.square { border-radius: 12px; border: 2px solid var(--gold-dim); } .avatar img { width: 100%; height: 100%; object-fit: cover; }

/* Inventário */
.inv { display: flex; flex-direction: column; gap: 8px; margin-bottom: 12px; }
.inv-item { display: flex; align-items: center; gap: 12px; padding: 10px; background: rgba(0, 0, 0, .25); border: 1px solid var(--border); border-left: 3px solid var(--gold-dim); border-radius: 10px; transition: .15s; }
.inv-item:hover { border-color: var(--gold-dim); border-left-color: var(--gold); background: rgba(217, 170, 76, .05); }
.inv-ico { width: 44px; height: 44px; flex: none; display: grid; place-items: center; font-size: 1.45rem; background: linear-gradient(135deg, #22323a, #151f24); border: 1px solid var(--border-2); border-radius: 9px; overflow: hidden; } .inv-ico.lg { width: 54px; height: 54px; }
.inv-ico img { width: 100%; height: 100%; object-fit: cover; }
.inv-txt { flex: 1; min-width: 0; display: flex; flex-direction: column; } .inv-txt b { font-weight: 600; } .inv-txt small { white-space: normal; }
.qty { font-weight: 700; color: #fff; background: var(--purple); padding: 1px 9px; border-radius: 99px; font-size: .8rem; }
.qty-ctrl { display: flex; align-items: center; gap: 8px; } .qty-ctrl span { min-width: 20px; text-align: center; font-weight: 700; }

/* Jogador */
.player-grid { display: grid; grid-template-columns: minmax(0, 1fr) 330px; gap: 20px; align-items: start; }
.col-main, .col-side { display: flex; flex-direction: column; gap: 16px; } .col-side { position: sticky; top: 84px; }
.panel.me { flex-direction: row; gap: 18px; align-items: center; } .me-info { flex: 1; display: flex; flex-direction: column; gap: 10px; min-width: 0; } .me-info h2 { font-size: 1.55rem; color: var(--gold-2); }
.party-list { display: flex; flex-direction: column; gap: 10px; }
.mate { display: flex; gap: 12px; padding: 10px; background: rgba(0, 0, 0, .22); border: 1px solid var(--border); border-radius: 12px; } .mate.off { opacity: .6; }
.mate-av { position: relative; flex: none; height: 52px; } .mate-av .dot { position: absolute; right: -4px; bottom: -4px; }
.mate-info { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 5px; } .mate-name { display: flex; align-items: center; gap: 8px; } .mate-name b { font-family: var(--serif); letter-spacing: .03em; }
.tag { font-size: .62rem; padding: 1px 8px; border-radius: 99px; background: var(--gold-dim); color: var(--gold-2); text-transform: uppercase; letter-spacing: .06em; }
.status { color: var(--muted); font-weight: 600; } .status.on { color: var(--ok); }

/* Biblioteca */
.lib { display: grid; grid-template-columns: repeat(auto-fill, minmax(350px, 1fr)); gap: 12px; }
.lib-card { display: flex; align-items: center; gap: 12px; padding: 12px; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); transition: .15s; } .lib-card:hover { border-color: var(--gold-dim); }
.lib-card b, .lib-card small { display: block; } .lib-card b { font-family: var(--serif); letter-spacing: .02em; } .lib-card small { margin-top: 2px; }
.lib-actions { display: flex; gap: 6px; align-items: center; flex: none; }
.media-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 16px; } .media-grid.wide { grid-template-columns: repeat(auto-fill, minmax(290px, 1fr)); }
.media-card { background: var(--surface); border: 1px solid var(--border); border-radius: 14px; overflow: hidden; transition: .15s; } .media-card:hover { border-color: var(--gold-dim); } .media-card.on { border-color: var(--gold); box-shadow: 0 0 0 1px var(--gold), 0 0 22px rgba(217, 170, 76, .22); }
.media-img { aspect-ratio: 4 / 3; background: repeating-conic-gradient(#172127 0 25%, #11191d 0 50%) 0 0 / 16px 16px; display: grid; place-items: center; }
.media-img img { width: 100%; height: 100%; object-fit: contain; } .media-grid.wide .media-img img { object-fit: cover; }
.media-foot { padding: 10px 12px; display: flex; flex-direction: column; gap: 8px; } .media-foot b { font-family: var(--serif); }

/* Modal (janela) */
.overlay { position: fixed; inset: 0; z-index: 50; background: rgba(3, 5, 7, .72); backdrop-filter: blur(5px); display: grid; place-items: center; padding: 16px; animation: fade .15s; }
.modal { width: 100%; max-width: 480px; max-height: 92vh; display: flex; flex-direction: column; background: linear-gradient(180deg, #131c21, #0e1519); border: 1px solid var(--gold-dim); border-radius: 18px; box-shadow: var(--shadow), 0 0 0 4px rgba(0, 0, 0, .3); } .modal.wide { max-width: 640px; }
.modal-head { display: flex; justify-content: space-between; align-items: center; padding: 12px 14px 12px 22px; border-bottom: 1px solid var(--border); background: linear-gradient(180deg, rgba(217, 170, 76, .08), transparent); border-radius: 18px 18px 0 0; }
.modal-head h3 { font-size: 1.05rem; color: var(--gold-2); }
.modal-body { padding: 18px 22px 22px; overflow-y: auto; display: flex; flex-direction: column; gap: 14px; }
.char-head { display: flex; gap: 14px; align-items: center; }
.sendlist { display: flex; flex-direction: column; gap: 4px; max-height: 280px; overflow-y: auto; } .sendlist .check { padding: 8px; border-radius: 10px; } .sendlist .check:hover { background: var(--elev); }
.cred { background: rgba(0, 0, 0, .35); border: 1px solid var(--gold-dim); border-radius: 12px; padding: 14px; margin: 0; font: .9rem/1.6 ui-monospace, Consolas, monospace; white-space: pre-wrap; word-break: break-all; color: var(--gold-2); }
.attr-edit { display: flex; flex-direction: column; gap: 8px; } .attr-edit .btn { align-self: flex-start; }

/* Upload de imagem */
.imgfield { display: flex; align-items: center; gap: 14px; } .imgfield b { display: block; font-size: .9rem; } .imgfield small { display: block; }
.imgfield-box { position: relative; width: 84px; height: 64px; border-radius: 12px; border: 1px dashed var(--gold-dim); background: rgba(0, 0, 0, .3); cursor: pointer; display: grid; place-items: center; color: var(--muted); overflow: hidden; padding: 0; flex: none; }
.imgfield-box.square { width: 72px; height: 72px; } .imgfield-box:hover { border-color: var(--gold); color: var(--gold-2); }
.imgfield-box img { width: 100%; height: 100%; object-fit: cover; } .imgfield-box em { position: absolute; inset: 0; display: grid; place-items: center; background: rgba(0, 0, 0, .7); font-size: .7rem; font-style: normal; color: #fff; }

/* ───────────── Dados ───────────── */
.fwin { position: fixed; right: 22px; bottom: 100px; z-index: 35; width: 350px; max-height: calc(100vh - 130px); display: flex; flex-direction: column; background: linear-gradient(180deg, #141d22, #0c1216); border: 1px solid var(--gold); border-radius: 16px; box-shadow: var(--shadow), 0 0 28px rgba(217, 170, 76, .12); animation: rise .25s ease; }
.fwin-head { display: flex; justify-content: space-between; align-items: center; padding: 10px 10px 10px 18px; border-bottom: 1px solid var(--border); background: linear-gradient(180deg, rgba(217, 170, 76, .12), transparent); border-radius: 15px 15px 0 0; }
.fwin-head h4 { font: 700 .9rem var(--serif); letter-spacing: .1em; text-transform: uppercase; color: var(--gold-2); } .fwin-actions { display: flex; gap: 6px; }
.fwin-body { padding: 14px 16px 16px; display: flex; flex-direction: column; gap: 14px; overflow-y: auto; }
.dice-sec { display: flex; flex-direction: column; gap: 8px; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chip { border: 1px solid var(--border-2); background: rgba(0, 0, 0, .25); color: var(--text); padding: 5px 11px; border-radius: 8px; cursor: pointer; font-size: .82rem; transition: .15s; } .chip b { color: var(--gold-2); margin-left: 3px; }
.chip:hover { border-color: var(--gold-dim); } .chip.on { border-color: var(--gold); background: rgba(217, 170, 76, .15); color: var(--gold-2); box-shadow: 0 0 12px rgba(217, 170, 76, .18); }
.dice-row { display: flex; flex-wrap: wrap; gap: 6px; } .dice-row.big { gap: 10px; }
.die-btn { background: none; border: 0; padding: 2px; cursor: pointer; border-radius: 10px; transition: .15s; } .die-btn:hover { transform: translateY(-2px) rotate(-4deg); }
.die polygon, .die circle { fill: #141e23; stroke: #6d6045; stroke-width: 2; transition: .15s; } .die text { fill: #b9a77c; font: 700 13px var(--serif); }
.die.on polygon, .die.on circle { fill: #2a2110; stroke: var(--gold); filter: drop-shadow(0 0 6px rgba(217, 170, 76, .55)); } .die.on text { fill: var(--gold-2); }
.result { display: flex; align-items: center; gap: 14px; padding: 12px; border-radius: 12px; background: rgba(0, 0, 0, .3); border: 1px solid var(--gold-dim); }
.result-die { position: relative; width: 84px; height: 84px; flex: none; } .result-die svg { position: absolute; inset: 0; } .result-die svg text { display: none; }
.result-die b { position: absolute; inset: 0; display: grid; place-items: center; font: 700 1.7rem var(--serif); color: #fff; text-shadow: 0 0 14px rgba(217, 170, 76, .7); }
.result.rolling .result-die { animation: shake .45s infinite; } .result.rolling .result-die b { color: var(--muted); }
@keyframes shake { 0%, 100% { transform: rotate(0); } 25% { transform: rotate(-9deg) scale(1.05); } 75% { transform: rotate(9deg) scale(1.05); } }
.result-txt { display: flex; flex-direction: column; gap: 3px; min-width: 0; } .result-txt b { font-family: var(--serif); }
.badge { align-self: flex-start; font: 700 .68rem Inter; text-transform: uppercase; letter-spacing: .08em; padding: 3px 10px; border-radius: 99px; } .badge.ok { background: rgba(62, 207, 142, .16); color: var(--ok); border: 1px solid rgba(62, 207, 142, .4); } .badge.bad { background: rgba(239, 91, 91, .14); color: var(--bad); border: 1px solid rgba(239, 91, 91, .4); }
.roll-log { display: flex; flex-direction: column; gap: 6px; }
.roll-row { display: flex; align-items: center; gap: 10px; padding: 6px 8px; border-radius: 8px; background: rgba(255, 255, 255, .025); } .roll-row b { display: block; font-size: .85rem; } .roll-row small { display: block; }
.roll-total { font: 700 1.15rem var(--serif); color: var(--gold-2); min-width: 30px; text-align: right; } .roll-total.ok { color: var(--ok); } .roll-total.bad { color: var(--bad); }
.banner { position: fixed; top: 78px; left: 50%; transform: translateX(-50%); z-index: 60; display: flex; align-items: center; gap: 12px; padding: 10px 16px 10px 12px; min-width: 300px; max-width: 92vw; background: linear-gradient(180deg, #1a232a, #0e1519); border: 1px solid var(--gold); border-radius: 14px; box-shadow: var(--shadow), 0 0 30px rgba(217, 170, 76, .25); animation: drop .35s cubic-bezier(.2, 1.2, .4, 1); }
.banner small { display: block; } .banner-total { font: 700 2rem var(--serif); color: var(--gold-2); text-shadow: 0 0 14px rgba(217, 170, 76, .6); min-width: 44px; text-align: center; } .banner-total.ok { color: var(--ok); } .banner-total.bad { color: var(--bad); }
@keyframes drop { from { opacity: 0; transform: translate(-50%, -16px) scale(.9); } }

/* Chamada de voz */
.dock { position: fixed; left: 82px; right: 0; bottom: 0; z-index: 30; padding: 12px 16px; pointer-events: none; }
.dock-in { pointer-events: auto; max-width: 780px; margin: 0 auto; display: flex; align-items: center; justify-content: space-between; gap: 14px; padding: 10px 12px 10px 16px; background: rgba(13, 19, 23, .92); backdrop-filter: blur(14px); border: 1px solid var(--gold-dim); border-radius: 18px; box-shadow: var(--shadow); }
.dock-people { display: flex; gap: 12px; overflow-x: auto; min-width: 0; align-items: center; }
.voice-p { display: flex; flex-direction: column; align-items: center; gap: 2px; flex: none; } .voice-p small { max-width: 60px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: .66rem; }
.dock-actions { display: flex; gap: 8px; flex: none; }
.dock-err { pointer-events: auto; max-width: 780px; margin: 0 auto 8px; background: rgba(239, 91, 91, .15); border: 1px solid #5a2d35; color: #ffb4b4; padding: 8px 12px; border-radius: 10px; font-size: .85rem; }

.toast { position: fixed; left: 50%; bottom: 110px; transform: translateX(-50%); z-index: 99; background: #19242a; border: 1px solid var(--gold-dim); padding: 10px 18px; border-radius: 12px; box-shadow: var(--shadow); animation: rise .2s; transition: opacity .4s; } .toast.out { opacity: 0; }
@keyframes fade { from { opacity: 0; } }

/* Responsivo: barra lateral vira barra inferior */
@media (max-width: 900px) {
  .player-grid { grid-template-columns: 1fr; } .col-side { position: static; order: -1; }
  .pickers { grid-template-columns: 1fr; }
}
@media (max-width: 760px) {
  .shell { flex-direction: column; }
  .rail { position: fixed; top: auto; bottom: 0; left: 0; right: 0; height: 66px; width: 100%; flex-direction: row; padding: 4px 8px; border-right: 0; border-top: 1px solid var(--border); }
  .rail-logo { display: none; } .rail-group { flex-direction: row; gap: 2px; } .rail > .rail-group:nth-of-type(1) { margin: 0; flex: 1; justify-content: space-around; }
  .rail-btn { width: 58px; } .rail-ico { width: 36px; height: 36px; } .rail-ico svg { width: 18px; height: 18px; } .rail-btn em { font-size: .58rem; }
  .content { padding-bottom: 190px; } .dock { left: 0; bottom: 66px; padding: 8px 10px; }
  .fwin { right: 10px; left: 10px; width: auto; bottom: 150px; max-height: calc(100vh - 230px); }
  .top { padding: 10px 14px; } .master-main, .player-grid { padding: 14px; }
}
@media (max-width: 560px) {
  .stage { aspect-ratio: 4 / 3; border-radius: 14px; }
  .grid2 { grid-template-columns: 1fr; } .grid2.narrow { grid-template-columns: 80px 1fr; }
  .panel.me { flex-direction: column; align-items: flex-start; } .lib { grid-template-columns: 1fr; } .lib-card.item { flex-wrap: wrap; }
  .dock-people small { display: none; } .banner { top: 64px; min-width: 0; width: 94vw; }
}
