:root {
  --bg: #14121c;
  --panel: #1f1b2b;
  --panel2: #2a2540;
  --ink: #f2eee6;
  --muted: #a49cb8;
  --comm: #e04a3a;
  --comm-soft: #ffb3a8;
  --cap: #2fae66;
  --cap-soft: #a8f0c4;
  --gold: #f3c13a;
  --pix: 'Press Start 2P', monospace;
  --txt: 'VT323', monospace;
}

* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; background: #000; overflow: hidden; }
body { color: var(--ink); font-family: var(--txt); }

#stage {
  position: fixed; left: 0; top: 0; width: 1920px; height: 1080px; /* fixed: no celular, não alarga a página */
  background: var(--bg) repeating-linear-gradient(0deg, transparent 0 3px, rgba(255,255,255,0.015) 3px 4px);
  transform-origin: 0 0;
  display: flex; flex-direction: column; padding: 14px 24px 16px;
}

header { height: 100px; flex-shrink: 0; display: grid; grid-template-columns: minmax(0, 1fr) 360px; grid-template-rows: auto auto; align-items: center; gap: 8px 24px; }
.title { font-family: var(--pix); font-size: 30px; letter-spacing: 1px; white-space: nowrap; }
.t-comm { color: var(--comm); text-shadow: 3px 3px 0 #5a1610; }
.t-cap { color: var(--cap); text-shadow: 3px 3px 0 #0e4a28; }
.vs { color: var(--gold); font-size: 18px; margin: 0 16px; vertical-align: middle; }
.cta { grid-column: 1 / -1; grid-row: 2; font-size: 23px; text-align: center; color: var(--ink); background: var(--panel); border: 3px solid var(--panel2); padding: 5px 14px; }
.cta b { font-family: var(--pix); font-size: 13px; font-weight: normal; }
.cta #handle { color: var(--gold); }
.c-comm { color: var(--comm); }
.c-cap { color: var(--cap); }
.clock { grid-column: 2; grid-row: 1; font-family: var(--pix); font-size: 12px; line-height: 1.6; display: flex; gap: 12px; align-items: center; justify-content: flex-end; color: var(--muted); }
.status { font-size: 14px; }
.status.on { color: var(--cap); }
.status.off { color: #6a6380; }
.status.err { color: var(--comm); }

main { display: grid; grid-template-columns: 1fr 1fr; gap: 24px; margin-top: 10px; }
.side { display: flex; flex-direction: column; gap: 8px; min-width: 0; }
.side-head { display: flex; justify-content: space-between; align-items: center; height: 46px; padding: 0 14px; border: 3px solid; }
.comm .side-head { background: #3a1512; border-color: var(--comm); }
.cap .side-head { background: #0f2d1d; border-color: var(--cap); }
.side-head .name { font-family: var(--pix); font-size: 17px; }
.comm .name { color: var(--comm-soft); }
.cap .name { color: var(--cap-soft); }
.icon { color: var(--gold); }
.score { display: flex; align-items: center; gap: 12px; }
.idx { font-family: var(--pix); font-size: 24px; color: var(--gold); min-width: 80px; text-align: right; }
.lead { font-family: var(--pix); font-size: 10px; background: var(--gold); color: #1a1400; padding: 4px 6px; animation: blink 1.2s steps(2) infinite; }
@keyframes blink { 50% { opacity: 0.55; } }

.frame { border: 4px solid #000; outline: 3px solid var(--panel2); line-height: 0; align-self: center; position: relative; }
canvas.map { width: 896px; height: 560px; image-rendering: pixelated; display: block; cursor: crosshair; }

.below { display: grid; grid-template-columns: 560px minmax(0, 1fr); gap: 10px; height: 196px; min-height: 0; }
.stats { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); grid-template-rows: repeat(2, minmax(0, 1fr)); gap: 6px; min-height: 0; min-width: 0; }
.stat { background: var(--panel); border: 2px solid var(--panel2); padding: 4px 7px; display: flex; flex-direction: column; justify-content: space-between; overflow: hidden; }
.stat .k { font-size: 18px; color: var(--muted); line-height: 1; white-space: nowrap; }
.stat .v { font-family: var(--pix); font-size: 12px; line-height: 1.5; overflow-wrap: anywhere; }
.stat .bar { height: 5px; background: #0c0a12; }
.stat .bar i { display: block; height: 100%; }
.comm .stat .bar i { background: var(--comm); }
.cap .stat .bar i { background: var(--cap); }
.stat.bad .v { color: #ff8a7a; }

.right { display: grid; grid-template-rows: minmax(0, 1fr) auto 68px; gap: 6px; min-width: 0; min-height: 0; }
.extra { font-size: 19px; line-height: 1.15; color: var(--ink); background: var(--panel); border: 2px solid var(--panel2); padding: 5px 8px; overflow: auto; overflow-wrap: anywhere; min-height: 0; }
.extra b { font-weight: normal; color: var(--gold); }
.feed { list-style: none; margin: 0; padding: 4px 8px; background: #0e0c15; border: 2px solid var(--panel2); flex: 1; overflow: hidden; font-size: 19px; line-height: 1.05; }
.feed li { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; color: #d6d0e4; }
.feed li .d { color: #6a6380; margin-right: 6px; }
.feed li.death { color: #ff9c8f; }
.feed li.join { color: #fff5c4; }
.feed li.rich { color: var(--gold); }
.feed li.plan { color: var(--comm-soft); }
.feed li.build { color: var(--cap-soft); }
.feed li.evict { color: #e0a070; }

footer { margin-top: 12px; flex: 1; display: grid; grid-template-columns: minmax(0, 1fr) 400px; gap: 24px; min-height: 0; }
.chart-wrap { background: var(--panel); border: 3px solid var(--panel2); padding: 6px 10px; display: flex; flex-direction: column; min-width: 0; min-height: 0; }
.chart-title { font-family: var(--pix); font-size: 10px; color: var(--muted); margin-bottom: 4px; }
#chart { width: 100%; flex: 1; image-rendering: pixelated; min-height: 0; }
.verdict { background: var(--panel); border: 3px solid var(--gold); display: flex; flex-direction: column; justify-content: center; align-items: center; text-align: center; padding: 6px; }
.v-label { font-family: var(--pix); font-size: 10px; color: var(--muted); }
#verdict { font-family: var(--pix); font-size: 22px; margin: 8px 0 4px; }
#verdict.comm { color: var(--comm); }
#verdict.cap { color: var(--cap); }
#verdict-sub { font-size: 22px; color: var(--muted); }

#toast {
  position: absolute; left: 50%; top: 330px; transform: translateX(-50%);
  background: #0e0c15; border: 4px solid var(--gold); box-shadow: 8px 8px 0 #000; padding: 18px 34px; text-align: center; min-width: 520px;
  animation: pop 0.25s steps(4);
}
#toast.comm { border-color: var(--comm); }
#toast.cap { border-color: var(--cap); }
@keyframes pop { from { transform: translateX(-50%) scale(0.6); } to { transform: translateX(-50%) scale(1); } }
.toast-k { font-family: var(--pix); font-size: 12px; color: var(--gold); }
.toast-name { font-family: var(--pix); font-size: 26px; margin: 14px 0 10px; }
.toast-prof { font-size: 32px; }
#toast.comm .toast-prof b { color: var(--comm); font-weight: normal; }
#toast.cap .toast-prof b { color: var(--cap); font-weight: normal; }

#tooltip { position: absolute; pointer-events: none; background: #0e0c15ee; border: 2px solid var(--gold); padding: 6px 10px; font-size: 21px; line-height: 1.05; z-index: 5; min-width: 220px; }
#tooltip b { font-family: var(--pix); font-size: 11px; font-weight: normal; color: var(--gold); display: block; margin-bottom: 4px; }

#gear { position: fixed; right: 10px; bottom: 10px; z-index: 20; background: #0008; color: #fff8; border: 1px solid #fff3; font-size: 18px; width: 34px; height: 34px; cursor: pointer; }
#gear:hover { color: #fff; }
#panel {
  position: fixed; right: 10px; bottom: 54px; z-index: 20; width: 520px; background: #1f1b2bf2; border: 3px solid var(--gold);
  padding: 12px 14px; font-family: system-ui, sans-serif; font-size: 14px; color: var(--ink);
}
#panel h2 { margin: 0 0 8px; font-size: 16px; }
#panel h2 small { color: var(--muted); font-weight: normal; }
#panel .row { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; margin: 8px 0; }
#panel input:not([type]) { flex: 1; min-width: 0; padding: 5px 7px; background: #0e0c15; color: #fff; border: 1px solid #555; }
#panel button { padding: 5px 9px; background: var(--panel2); color: #fff; border: 1px solid #5a5370; cursor: pointer; }
#panel button:hover { background: #3a3358; }
#panel button.on { background: var(--gold); color: #1a1400; }
#panel .danger button { background: #4a1a1a; border-color: #803030; }
#panel-msg { min-height: 18px; color: var(--gold); }
#ig-status { color: var(--muted); font-size: 12px; white-space: pre-wrap; }

#blocked { position: absolute; inset: 0; z-index: 10; background: #0b0910e6; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 18px; text-align: center; }
#blocked[hidden] { display: none; }
#blocked div { font-family: var(--pix); font-size: 24px; color: var(--gold); }
#blocked p { font-size: 32px; margin: 0; color: var(--ink); }
#blocked button { font-family: var(--pix); font-size: 16px; padding: 14px 22px; background: var(--gold); color: #1a1400; border: 0; cursor: pointer; box-shadow: 5px 5px 0 #000; }

.missing { font-size: 18px; line-height: 1.15; padding: 3px 8px; background: #2a0f0c; border: 2px solid #6e2a20; color: #ffb3a8; overflow: auto; max-height: 50px; }
.missing.ok { background: #0f2418; border-color: #2a5a3a; color: var(--cap-soft); }
.missing b { font-family: var(--pix); font-size: 9px; font-weight: normal; margin-right: 6px; }

#novela-status, #ai-status { color: var(--muted); font-size: 12px; margin-bottom: 6px; }
#novela-link { color: var(--gold); }

.wev { color: #ff8a7a; }
#verdict .el { display: block; font-family: var(--txt, inherit); font-size: 15px; line-height: 1.35; }
#verdict .el.comm { color: var(--comm); }
#verdict .el.cap { color: var(--cap); }
#verdict .el b { color: var(--gold); }

/* ---------- busca pelo @ e cartão do personagem ---------- */
#busca { position: fixed; top: 12px; right: 16px; z-index: 50; display: flex; gap: 6px; background: rgba(20,18,28,0.92); border: 3px solid var(--gold); padding: 6px; }
#busca input { font-family: var(--txt, 'VT323', monospace); font-size: 22px; width: 240px; background: #0e0c15; color: var(--ink); border: 2px solid var(--panel2); padding: 4px 8px; outline: none; }
#busca input:focus { border-color: var(--gold); }
#busca button { font-family: var(--pix); font-size: 11px; background: var(--gold); color: #1a1400; border: 0; padding: 0 12px; cursor: pointer; }
#perfil { position: fixed; top: 70px; right: 10px; z-index: 50; width: 380px; max-height: calc(100vh - 90px); overflow: auto; background: rgba(20,18,28,0.96); border: 3px solid var(--gold); padding: 14px 14px 10px; color: var(--ink); font-family: var(--txt, 'VT323', monospace); font-size: 21px; line-height: 1.25; }
#perfil.comm { border-color: var(--comm); }
#perfil.cap { border-color: var(--cap); }
#perfil-x { position: absolute; top: 6px; right: 8px; background: none; border: 0; color: var(--muted); font-size: 22px; cursor: pointer; }
#perfil .p-name { font-family: var(--pix); font-size: 15px; color: var(--gold); word-break: break-all; padding-right: 26px; }
#perfil .p-side { display: inline-block; font-family: var(--pix); font-size: 10px; padding: 3px 6px; margin: 8px 0 6px; }
#perfil .p-side.comm { background: var(--comm); color: #fff; }
#perfil .p-side.cap { background: var(--cap); color: #04140a; }
#perfil .p-row { display: flex; justify-content: space-between; gap: 12px; border-top: 1px solid #2a2540; padding: 3px 0; }
#perfil .p-row span:first-child { color: var(--muted); }
#perfil .p-row span:last-child { text-align: right; }
#perfil .p-bar { height: 8px; background: #0e0c15; margin: 2px 0 4px; }
#perfil .p-bar i { display: block; height: 100%; background: var(--gold); }
#perfil .p-tag { display: inline-block; font-family: var(--pix); font-size: 9px; padding: 3px 5px; margin: 2px 3px 2px 0; background: #2a2540; }
#perfil .p-tag.bad { background: #3a1512; color: #ffb3a8; }
#perfil .p-tag.good { background: #0f2d1d; color: #bff0cf; }
#perfil .p-note { color: var(--muted); font-size: 18px; margin-top: 6px; }
#perfil-cam { display: block; width: 100%; margin-top: 8px; image-rendering: pixelated; border: 2px solid #2a2540; background: #000; }
body.obs #busca, body.obs #perfil { display: none !important; }
@media (max-width: 900px) {
  #busca { left: 78px; right: 8px; top: 10px; }
  #busca input { flex: 1; width: auto; min-width: 0; font-size: 20px; }
  #perfil { left: 6px; right: 6px; top: 136px; bottom: auto; width: auto; max-height: calc(100vh - 148px); max-height: calc(100dvh - 148px); font-size: 19px; }
  body:not(.obs) { overflow: auto; padding-top: 136px; }
  html:has(body:not(.obs)) { overflow: auto; }
  body:not(.obs) #stage { position: relative; width: 100%; height: auto; padding: 12px 10px 20px; }
  body:not(.obs) header { height: auto; grid-template-columns: minmax(0, 1fr); grid-template-rows: auto auto auto; gap: 12px; }
  body:not(.obs) .title { font-size: clamp(10px, 2.8vw, 24px); text-align: center; letter-spacing: 0; }
  body:not(.obs) .vs { font-size: 0.65em; margin: 0 6px; }
  body:not(.obs) .clock { grid-column: 1; grid-row: 2; justify-content: center; font-size: 10px; }
  body:not(.obs) .cta { grid-row: 3; font-size: 19px; line-height: 1.5; padding: 8px; }
  body:not(.obs) .cta b { font-size: 10px; }
  body:not(.obs) main { grid-template-columns: minmax(0, 1fr); gap: 24px; margin-top: 18px; }
  body:not(.obs) .side-head { height: 42px; padding: 0 8px; }
  body:not(.obs) .side-head .name { font-size: clamp(9px, 2.5vw, 16px); }
  body:not(.obs) .idx { font-size: 18px; min-width: 54px; }
  body:not(.obs) .lead { font-size: 7px; padding: 3px; }
  body:not(.obs) .score { gap: 5px; }
  body:not(.obs) .frame { width: 100%; }
  body:not(.obs) canvas.map { width: 100%; height: auto; aspect-ratio: 8 / 5; }
  body:not(.obs) .below { height: auto; grid-template-columns: minmax(0, 1fr); }
  body:not(.obs) .stats { grid-template-columns: repeat(2, minmax(0, 1fr)); grid-template-rows: none; grid-auto-rows: minmax(76px, auto); }
  body:not(.obs) .right { grid-template-rows: auto auto 86px; }
  body:not(.obs) .extra { max-height: 150px; }
  body:not(.obs) footer { grid-template-columns: minmax(0, 1fr); gap: 12px; margin-top: 20px; }
  body:not(.obs) .chart-wrap { height: 160px; }
  body:not(.obs) .verdict { min-height: 120px; }
}
body.public #gear, body.public #panel { display: none !important; }

#mobile-tabs { display: none; }
@media (max-width: 900px) {
  body:not(.obs) #mobile-tabs { position: fixed; top: 72px; left: 8px; right: 8px; z-index: 45; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; padding: 4px 0 8px; background: var(--bg); }
  #mobile-tabs button { min-height: 46px; padding: 10px 4px; background: var(--panel); border: 2px solid var(--panel2); color: var(--muted); font-family: var(--pix); font-size: clamp(8px, 2.4vw, 12px); cursor: pointer; }
  #mobile-tabs button:focus-visible { outline: 2px solid var(--gold); outline-offset: 3px; }
  #tab-comm[aria-selected="true"] { background: #3a1512; border-color: var(--comm); color: var(--comm-soft); }
  #tab-cap[aria-selected="true"] { background: #0f2d1d; border-color: var(--cap); color: var(--cap-soft); }
  body:not(.obs)[data-mobile-side="comm"] .side.cap,
  body:not(.obs)[data-mobile-side="cap"] .side.comm { display: none; }
  body:not(.obs) footer .verdict { display: none; }
}

#online-badge {
  position: fixed; left: max(16px, env(safe-area-inset-left)); top: 7px;
  width: 60px; height: 60px; border-radius: 50%; z-index: 40;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 5px;
  background: var(--bg); border: 3px solid var(--gold); box-shadow: 3px 4px 0 #0009;
  color: var(--ink); pointer-events: auto;
}
#online-badge strong { font-family: var(--txt); font-size: 25px; line-height: 1; font-weight: normal; font-variant-numeric: tabular-nums; }
.online-label { font-family: var(--pix); font-size: 6px; color: var(--muted); }
.online-dot { position: absolute; top: 5px; width: 4px; height: 4px; border-radius: 50%; background: var(--muted); }
#online-badge.connected .online-dot { background: var(--cap); }
body.obs #online-badge { display: none; }
@media (max-width: 900px) {
  #online-badge { width: 58px; height: 58px; left: 10px; }
  #online-badge strong { font-size: 24px; }
}

/* ---------- chat do dia ---------- */
#chat-btn { position: fixed; left: max(14px, env(safe-area-inset-left)); bottom: max(14px, env(safe-area-inset-bottom)); z-index: 55; display: flex; align-items: center; gap: 8px; padding: 10px 14px; background: var(--gold); color: #1a1400; border: 0; box-shadow: 3px 4px 0 #0009; font-family: var(--pix); font-size: 12px; cursor: pointer; }
#chat-btn.on { background: var(--ink); }
#chat-btn .cb-ico { font-size: 14px; }
#chat-unread { position: absolute; top: -9px; right: -9px; min-width: 22px; height: 22px; padding: 0 5px; border-radius: 11px; background: var(--comm); color: #fff; font: 11px/22px var(--pix); text-align: center; }
#chat { position: fixed; left: 10px; top: 80px; bottom: 66px; width: 400px; z-index: 56; display: flex; flex-direction: column; background: rgba(20,18,28,0.97); border: 3px solid var(--gold); box-shadow: 4px 5px 0 #000a; color: var(--ink); font-family: var(--txt); }
#chat[hidden] { display: none; }
.ch-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 8px; padding: 10px 12px 8px; border-bottom: 2px solid var(--panel2); }
.ch-title { font-family: var(--pix); font-size: 13px; color: var(--gold); }
.ch-sub { font-size: 18px; color: var(--muted); margin-top: 4px; }
.ch-x { background: none; border: 0; color: var(--muted); font-size: 22px; cursor: pointer; }
#chat-list { list-style: none; margin: 0; padding: 8px 10px; flex: 1; overflow-y: auto; overscroll-behavior: contain; min-height: 0; }
#chat-empty { padding: 16px; color: var(--muted); font-size: 20px; text-align: center; }
#chat-empty[hidden] { display: none; }
.cm { padding: 6px 8px 4px; margin-bottom: 6px; background: var(--panel); border-left: 4px solid var(--panel2); transition: background .3s; }
.cm.comm { border-left-color: var(--comm); }
.cm.cap { border-left-color: var(--cap); }
.cm.mine { background: #262036; }
.cm.flash { background: #4a3d10; }
.cm-head { display: flex; align-items: baseline; gap: 8px; flex-wrap: wrap; }
.cm-name { background: none; border: 0; padding: 0; font: 19px var(--txt); cursor: pointer; text-align: left; word-break: break-all; }
.cm-name.comm { color: var(--comm-soft); }
.cm-name.cap { color: var(--cap-soft); }
.cm-name:hover { text-decoration: underline; }
.cm-prof { color: var(--muted); font-size: 16px; }
.cm-time { margin-left: auto; color: #6a6380; font-size: 16px; }
.cm-quote { margin: 3px 0; padding: 2px 6px; border-left: 2px solid var(--muted); color: var(--muted); font-size: 17px; cursor: pointer; overflow-wrap: anywhere; }
.cm-text { font-size: 21px; line-height: 1.15; overflow-wrap: anywhere; white-space: pre-wrap; }
.cm-text.del { color: #6a6380; font-style: italic; }
.cm-act { display: flex; gap: 14px; margin-top: 2px; }
.cm-act button { background: none; border: 0; padding: 2px 0; color: var(--muted); font: 17px var(--txt); cursor: pointer; }
.cm-like.on { color: var(--comm); }
.cm-act button:hover { color: var(--ink); }
.ch-foot { border-top: 2px solid var(--panel2); padding: 8px 10px 10px; }
.ch-hint { color: var(--muted); font-size: 18px; margin-bottom: 5px; }
.ch-row { display: flex; gap: 6px; }
.ch-row input, .ch-row textarea { flex: 1; min-width: 0; background: #0e0c15; color: var(--ink); border: 2px solid var(--panel2); padding: 5px 8px; font: 20px var(--txt); outline: none; resize: none; }
.ch-row input:focus, .ch-row textarea:focus { border-color: var(--gold); }
.ch-row button { background: var(--gold); color: #1a1400; border: 0; padding: 0 10px; font: 10px var(--pix); cursor: pointer; }
.ch-row button:disabled { opacity: .5; }
.ch-me { display: flex; justify-content: space-between; gap: 6px; font-size: 18px; color: var(--muted); margin-bottom: 5px; }
.ch-me b { font-weight: normal; }
.ch-me b.comm { color: var(--comm-soft); }
.ch-me b.cap { color: var(--cap-soft); }
#chat-out { background: none; border: 0; color: var(--muted); font: 17px var(--txt); text-decoration: underline; cursor: pointer; }
#chat-reply { display: flex; justify-content: space-between; gap: 6px; background: #0e0c15; border-left: 3px solid var(--gold); padding: 3px 6px; margin-bottom: 5px; font-size: 17px; color: var(--muted); }
#chat-reply[hidden] { display: none; }
#chat-reply span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
#chat-reply button { background: none; border: 0; color: var(--muted); cursor: pointer; }
#chat-err { color: var(--comm-soft); font-size: 18px; margin-top: 4px; min-height: 0; }
#chat-err:empty { display: none; }
body.obs #chat, body.obs #chat-btn { display: none !important; }
@media (max-width: 900px) {
  #chat { left: 0; right: 0; top: 0; bottom: 0; width: auto; border-width: 0; height: 100dvh; background: var(--bg); }
  #chat-btn { left: auto; right: max(12px, env(safe-area-inset-right)); bottom: max(12px, env(safe-area-inset-bottom)); }
  .ch-row input, .ch-row textarea { font-size: 20px; }
}
.cm-mod { display: flex; gap: 12px; margin-top: 3px; padding-top: 3px; border-top: 1px dashed #3a3350; }
.cm-mod button { background: none; border: 0; padding: 0; color: #ff8a7a; font: 16px var(--txt); cursor: pointer; text-decoration: underline; }
#chat.mod { border-color: var(--comm); }
#chat.mod .ch-title::after { content: ' · MODERAÇÃO'; color: var(--comm-soft); }
#chat-mod-banned .row { font-size: 16px; }
.cm.admin { border-left-color: var(--gold); background: #2a2410; }
.cm-name.admin, .ch-me b.admin { color: var(--gold); }
.cm-admin { font-family: var(--pix); font-size: 8px; padding: 3px 5px; background: var(--gold); color: #1a1400; }
#chat-modbar { border-bottom: 2px dashed #5a2a24; padding: 0 0 6px; margin-bottom: 6px; font-size: 17px; color: var(--comm-soft); }
#chat-modbar[hidden] { display: none; }
#chat-modbanned .row { display: flex; gap: 8px; align-items: center; }
#chat-modbanned button { background: none; border: 0; color: var(--gold); font: 16px var(--txt); text-decoration: underline; cursor: pointer; }
.ch-body { position: relative; flex: 1; min-height: 0; display: flex; flex-direction: column; }
.ch-body #chat-list { flex: 1; }
#chat-down { position: absolute; right: 16px; bottom: 14px; z-index: 2; width: 52px; height: 52px; border-radius: 50%; border: 3px solid #1a1400; background: var(--gold); color: #1a1400; font: 26px/1 var(--pix); cursor: pointer; box-shadow: 3px 4px 0 #000a; display: flex; align-items: center; justify-content: center; }
#chat-down[hidden] { display: none; }
#chat-down b { position: absolute; top: -10px; left: -10px; min-width: 24px; height: 24px; padding: 0 5px; border-radius: 12px; background: var(--comm); color: #fff; font: 11px/24px var(--pix); }
#chat-down b[hidden] { display: none; }
/* .ch-row usa display:flex, que venceria o atributo hidden */
#chat .ch-row[hidden], #chat form[hidden] { display: none; }
#chat-keyrow { margin-top: 6px; }
/* o painel nunca deixa a lista vazar para fora da borda */
#chat { overflow: hidden; }

/* ---------- meu personagem ---------- */
#eu-btn { position: fixed; left: max(14px, env(safe-area-inset-left)); bottom: calc(max(14px, env(safe-area-inset-bottom)) + 52px); z-index: 55; display: flex; align-items: center; gap: 8px; padding: 10px 14px; background: var(--panel); color: var(--ink); border: 2px solid var(--gold); box-shadow: 3px 4px 0 #0009; font-family: var(--pix); font-size: 10px; cursor: pointer; }
#eu-btn.on { background: var(--gold); color: #1a1400; }
#eu-btn.done { border-color: var(--cap); }
#eu-ok { color: var(--cap); font-size: 14px; }
#eu { position: fixed; left: 10px; bottom: 124px; width: 400px; max-height: calc(100vh - 140px); z-index: 57; display: flex; flex-direction: column; overflow: hidden; background: rgba(20,18,28,0.97); border: 3px solid var(--gold); box-shadow: 4px 5px 0 #000a; color: var(--ink); font-family: var(--txt); }
#eu[hidden], #eu [hidden] { display: none !important; }
.eu-body { padding: 10px 12px 12px; overflow-y: auto; font-size: 20px; line-height: 1.2; }
.eu-body p { margin: 0 0 10px; }
.eu-body .ch-row { display: flex; gap: 6px; }
.eu-body input { flex: 1; min-width: 0; background: #0b0a10; color: var(--ink); border: 2px solid var(--panel2); padding: 8px; font: 20px var(--txt); }
.eu-body button:not(.eu-link), .eu-dm { background: var(--gold); color: #1a1400; border: 0; padding: 8px 12px; font: 10px var(--pix); cursor: pointer; text-decoration: none; display: inline-block; }
.eu-body button:disabled { opacity: .5; }
.eu-code { display: flex; align-items: center; gap: 8px; margin: 4px 0 10px; }
.eu-code code { flex: 1; text-align: center; padding: 10px; background: #0b0a10; border: 2px dashed var(--gold); color: var(--gold); font: 16px var(--pix); letter-spacing: 2px; user-select: all; }
.eu-dm { display: block; text-align: center; margin-bottom: 10px; background: var(--ink); }
.eu-status { color: var(--gold); }
.eu-status::before { content: '● '; animation: eu-blink 1.2s steps(2) infinite; }
@keyframes eu-blink { 50% { opacity: .2; } }
.eu-small { font-size: 17px; color: var(--muted); }
.eu-link { background: none; border: 0; padding: 0; color: var(--muted); font: inherit; text-decoration: underline; cursor: pointer; }
.eu-who { display: flex; gap: 10px; align-items: center; margin-bottom: 12px; }
.eu-check { width: 34px; height: 34px; border-radius: 50%; background: var(--cap); color: #04130a; display: grid; place-items: center; font-size: 22px; }
.eu-who b { font-size: 24px; }
#eu-dinfo.comm { color: var(--comm-soft); }
#eu-dinfo.cap { color: var(--cap-soft); }
#eu-dinfo.dead { color: var(--muted); }
#eu-map { margin-bottom: 10px; }
#eu-err { color: #ff8a7a; font-size: 18px; min-height: 0; }
body.obs #eu, body.obs #eu-btn { display: none !important; }
@media (max-width: 900px) {
  #eu-btn { left: auto; right: max(12px, env(safe-area-inset-right)); bottom: calc(max(12px, env(safe-area-inset-bottom)) + 52px); }
  #eu { left: 0; right: 0; bottom: 0; width: auto; max-height: 100dvh; border-width: 3px 0 0; }
}
/* conselhos do "Meu personagem" */
#eu h4 { margin: 14px 0 6px; font: 10px var(--pix); color: var(--gold); }
#eu-now { margin-bottom: 8px; color: var(--ink); }
.eu-p { display: flex; align-items: center; gap: 8px; padding: 6px 0; border-top: 1px dashed #3a3350; }
.eu-pl { flex: 1; min-width: 0; }
.eu-pl b { display: block; font-weight: normal; font-size: 20px; }
.eu-pl span { display: block; font-size: 16px; color: var(--muted); }
.eu-bar { position: relative; height: 6px; margin-top: 4px; background: #0b0a10; }
.eu-bar i { position: absolute; left: 0; top: 0; bottom: 0; background: var(--gold); }
.eu-bar u { position: absolute; top: -3px; bottom: -3px; width: 2px; background: var(--ink); text-decoration: none; }
.eu-seg { display: flex; flex: none; }
.eu-body .eu-seg button { padding: 7px 7px; background: #0b0a10; color: var(--muted); border: 1px solid var(--panel2); font-size: 8px; }
.eu-body .eu-seg button.on { color: #1a1400; background: var(--ink); }
.eu-body .eu-seg button.on.v1 { background: var(--cap); }
.eu-body .eu-seg button.on.v-1 { background: var(--comm); color: #fff; }
#eu-wish { width: 100%; background: #0b0a10; color: var(--ink); border: 2px solid var(--panel2); padding: 7px; font: 20px var(--txt); }
#eu-wishst { margin: 6px 0; font-size: 18px; }
#eu-wishst.ok { color: var(--cap); }
#eu-wishst.wait { color: var(--gold); }
#eu-save { width: 100%; margin-top: 4px; }
#eu-fair { margin-top: 10px; padding: 8px; border: 1px solid var(--panel2); font-size: 17px; color: var(--muted); }
