:root {
  --bg: #0e130e;
  --panel: rgba(18, 24, 17, 0.92);
  --panel2: #1c2519;
  --line: #3a4a33;
  --ink: #efe9d8;
  --dim: #a9b39b;
  --gold: #e3b95f;
  --gold2: #b98a2e;
  --bad: #ff7a6b;
  --good: #8fd26a;
  --font: 'Alegreya Sans', system-ui, sans-serif;
  --title: 'Alegreya SC', Georgia, serif;
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
html, body { margin: 0; height: 100%; background: var(--bg); color: var(--ink); font: 15px/1.4 var(--font); overflow: hidden; }
/* Sem seleção de texto no jogo (tarefa 61): no celular, o toque longo no mapa (a ordem) selecionava a página inteira e
   abria o menu do navegador (copiar, pesquisar, a lupa). Só os campos de digitar e o que é para copiar (.copiar) continuam
   selecionáveis; o iPhone lê os nomes com -webkit-. O que escapa do CSS, input.js segura (selectstart e o menu do toque
   longo). */
html, body { -webkit-user-select: none; user-select: none; -webkit-touch-callout: none; }
input, textarea, select, [contenteditable], .copiar { -webkit-user-select: text; user-select: text; -webkit-touch-callout: default; }
button { font: inherit; color: var(--ink); background: var(--panel2); border: 1px solid var(--line); border-radius: 6px; padding: 7px 12px; cursor: pointer; }
button:hover:not(:disabled) { border-color: var(--gold2); }
button:disabled { opacity: 0.45; cursor: default; }
button.primary { background: var(--gold); color: #1d1606; border-color: var(--gold); font-weight: 700; }
button:focus-visible, input:focus-visible { outline: 2px solid var(--gold); outline-offset: 2px; }
input { font: inherit; color: var(--ink); background: #0b100a; border: 1px solid var(--line); border-radius: 6px; padding: 8px 10px; width: 100%; }

#view { position: fixed; inset: 0; }
#view canvas { display: block; }

/* telas de entrada */
.screen { position: fixed; inset: 0; display: grid; place-items: center; padding: 16px;
  background: radial-gradient(ellipse at 50% 30%, rgba(40, 60, 30, 0.55), rgba(8, 11, 8, 0.92)); z-index: 20; }
.screen[hidden] { display: none; }
#found { place-items: start center; overflow-y: auto; }     /* com o brasão, o cartão pode passar da altura do celular */
#found .card { margin-block: auto; }
.card { width: min(420px, 100%); background: var(--panel); border: 1px solid var(--line); border-radius: 12px; padding: 26px 26px 20px; box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5); }
.card h1 { font: 700 44px/1 var(--title); margin: 4px 0 10px; color: var(--gold); }
.kicker { margin: 0; font-size: 12px; letter-spacing: 0.12em; text-transform: uppercase; color: var(--dim); }
.lead { color: var(--dim); margin: 0 0 18px; }
.card label { display: block; margin: 0 0 12px; color: var(--dim); font-size: 13px; }
.card label input { margin-top: 4px; }
.row { display: flex; gap: 8px; margin-top: 6px; }
.err { color: var(--bad); min-height: 1.4em; margin: 10px 0 0; }
.note { color: var(--dim); font-size: 13px; margin: 10px 0 0; }
.note.ok { color: var(--good); }
/* a entrada (tarefa 46, entrada.js): criar conta com o e-mail, Esqueci minha senha, a senha nova e os links do e-mail;
   o cartão pode passar da altura do celular deitado */
#gate { place-items: start center; overflow-y: auto; }
#gate .card { margin-block: auto; }
.g-h { font: 700 22px var(--title); color: var(--gold); margin: 0 0 10px; }
.g-top { margin: -4px 0 12px; }
.g-why { margin: -6px 0 12px; font-size: 12.5px; }
.g-links { margin: 12px 0 0; }
.g-done { margin: 0 0 14px; }
button.link { background: none; border: 0; border-radius: 3px; padding: 0; color: var(--gold); text-decoration: underline; text-underline-offset: 2px; font-size: 14px; }
button.link:hover:not(:disabled) { color: #f2cf7e; }
#f-mail { color: var(--good); }

/* jogo */
#hud { position: fixed; inset: 0; pointer-events: none; z-index: 10; }
#hud > * { pointer-events: auto; }
#hud #labels, #hud #box, #hud #toasts, #hud #loading, #hud #banner { pointer-events: none; }
/* o subsolo da mina funda (subsolo.js): cobre o mapa embaixo do topo; o painel, os rótulos e o povo do mapa somem */
#hud.ug #panel, #hud.ug #labels, #hud.ug #box, #hud.ug #event, #hud.ug #evbox, #hud.ug #povo, #hud.ug #pv-tab, #hud.ug #wmap, #hud.ug #banner { display: none !important; }
#ug { position: absolute; z-index: 2; inset: 40px 0 0 0; display: flex; flex-direction: column; }
#ug[hidden] { display: none; }
#ug-bar { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 8px; padding: 6px 10px; background: linear-gradient(rgba(16, 12, 9, 0.92), rgba(16, 12, 9, 0.78));
  border-bottom: 1px solid #4a3a2c; }
#ug-title { font-family: var(--title); font-size: 17px; color: var(--gold); white-space: nowrap; }
/* ug-made: a produção da mina (tarefa 62), num grupo à parte: quando não cabe na linha dos números, vai para a dos botões */
#ug-stats, #ug-made { display: flex; flex-wrap: wrap; gap: 4px; }
#ug-made:empty { display: none; }
:is(#ug-stats, #ug-made) .chip { display: inline-flex; align-items: center; gap: 4px; padding: 2px 8px; border-radius: 6px; background: rgba(255, 255, 255, 0.06); font-size: 13.5px; white-space: nowrap; }
:is(#ug-stats, #ug-made) .chip b { font-variant-numeric: tabular-nums; }
:is(#ug-stats, #ug-made) .chip.bad { color: var(--bad); background: rgba(255, 122, 107, 0.1); }
#ug-bar .sp { flex: 1; }
/* os três botões andam juntos: se a barra não couber numa linha, vão juntos para a de baixo, à direita (no celular,
   cada um quebra sozinho, como antes); no computador médio, o título encurta para "Subsolo", e a barra cabe numa
   linha com a produção da mina (tarefa 62) */
#ug-btns { display: flex; gap: 6px 8px; margin-left: auto; }
@media (max-width: 900px), (max-height: 500px) and (orientation: landscape) { #ug-btns { display: contents; } }
@media (min-width: 901px) and (max-width: 1499px) and (min-height: 501px) { #ug-title .ugt-long { display: none; } }
#ug-bar button { display: inline-flex; align-items: center; gap: 5px; padding: 4px 10px; font-size: 14px; }
#ug-bar button .ico { width: 16px; height: 16px; }
#ug-auto[aria-pressed=true] { border-color: var(--good); color: var(--good); background: rgba(143, 210, 106, 0.12); }
#ug-cv { flex: 1; cursor: crosshair; touch-action: none; }
#ug-cv.grab { cursor: grabbing; }
#ug-labels { position: fixed; inset: 0; overflow: hidden; pointer-events: none !important; }
.ugt { position: absolute; left: 0; top: 0; padding: 2px 7px; border-radius: 6px; background: rgba(12, 9, 7, 0.82); border: 1px solid rgba(255, 255, 255, 0.12);
  font-size: 12.5px; white-space: nowrap; display: inline-flex; align-items: center; gap: 3px; }
.ugt .ico { width: 14px; height: 14px; }
.ugt.why { color: #ffb36b; border-color: rgba(255, 160, 80, 0.5); }
.ugt.tip { display: block; white-space: normal; width: max-content; max-width: 280px; padding: 6px 9px; font-size: 13px; line-height: 1.35; }
.ugt.tip .ico { vertical-align: -2px; }
#ug-sel { right: 12px; top: 56px; width: 250px; }
#ug-sel h3 { margin: 0 0 6px; font-size: 16px; display: flex; align-items: center; gap: 6px; }
#ug-sel h3 small { color: var(--dim); font-weight: 400; }
#ug-sel p { margin: 4px 0; font-size: 13.5px; display: flex; align-items: center; gap: 5px; flex-wrap: wrap; }
#ug-sel button { margin-top: 6px; display: inline-flex; align-items: center; gap: 5px; }
#ug-foot { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 14px; padding: 4px 10px; background: rgba(12, 9, 7, 0.8); border-top: 1px solid #4a3a2c;
  font-size: 12.5px; color: var(--dim); }
#ug-legend { display: flex; flex-wrap: wrap; gap: 10px; }
#ug-legend span { display: inline-flex; align-items: center; gap: 4px; white-space: nowrap; }
#ug-legend i { width: 11px; height: 11px; border-radius: 3px; border: 1px solid rgba(255, 255, 255, 0.25); }
#ug-help { flex: 1; min-width: 240px; }
#top { position: absolute; z-index: 2; top: 0; left: 0; right: 0; height: 40px; display: flex; align-items: center; justify-content: space-between;
  padding: 0 10px; background: linear-gradient(rgba(10, 14, 9, 0.9), rgba(10, 14, 9, 0.7)); border-bottom: 1px solid var(--line); gap: 10px; }
#res { display: flex; gap: 6px; flex-wrap: nowrap; overflow: hidden; }
.res { display: flex; align-items: center; gap: 6px; padding: 3px 10px 3px 6px; border-radius: 6px; background: rgba(255, 255, 255, 0.04); white-space: nowrap; }
.res b { font-variant-numeric: tabular-nums; min-width: 2.5em; }
.res.full b { color: var(--bad); }
.res small { margin-left: -4px; font-size: 11px; opacity: 0.55; font-variant-numeric: tabular-nums; }   /* o limite (os armazéns) */
.ico { width: 18px; height: 18px; flex: none; display: inline-block; }
/* o brasão do reino (tarefa 37, crest.js) antes do nome: listas, conversa, painéis e o nome em cima do castelo */
.crest { display: inline-block; flex: none; vertical-align: -4px; margin-right: 5px; }
.lbl .crest { vertical-align: -4px; margin-right: 4px; filter: drop-shadow(0 1px 2px rgba(0, 0, 0, 0.9)); }
.chip .crest { vertical-align: -3px; margin-right: 4px; }
#realm { display: flex; align-items: center; gap: 8px; white-space: nowrap; }
#r-home { display: flex; align-items: center; gap: 8px; cursor: pointer; padding: 6px 2px; }
#r-dot { width: 12px; height: 12px; border-radius: 50%; border: 2px solid rgba(255, 255, 255, 0.7); }
#r-dot.cr { width: auto; height: auto; border: 0; border-radius: 0; display: inline-flex; }
#r-dot.cr .crest { margin: 0; vertical-align: 0; display: block; }
#r-net { width: 8px; height: 8px; border-radius: 50%; background: var(--good); }
#r-net.off { background: var(--bad); }
#r-menu { padding: 3px 9px; }
#r-mus { padding: 3px 9px; }
#r-mus.off { color: var(--dim); text-decoration: line-through; }
.pop { position: absolute; z-index: 6; background: var(--panel); border: 1px solid var(--line); border-radius: 10px; padding: 10px; box-shadow: 0 10px 40px rgba(0, 0, 0, 0.5); }
.pop[hidden] { display: none; }
#menu { top: 46px; right: 10px; display: grid; gap: 6px; }
/* som: liga/desliga e volume de música, efeitos e ambiente */
#menu .som { display: grid; grid-template-columns: auto 120px; gap: 6px 12px; align-items: center; padding: 2px 2px 10px; margin-bottom: 2px; border-bottom: 1px solid var(--line); font-size: 14px; }
#menu .som label { display: flex; align-items: center; gap: 7px; cursor: pointer; white-space: nowrap; margin: 0; }
#menu .som .lb { padding-left: 23px; color: var(--dim); }
#menu .som input[type="checkbox"] { width: 16px; height: 16px; margin: 0; padding: 0; accent-color: var(--gold); }
#menu .som input[type="range"] { width: 100%; margin: 0; padding: 0; border: 0; background: none; accent-color: var(--gold); }
#menu .som input:disabled { opacity: 0.4; }
#menu .som .now { grid-column: 1 / -1; margin: 0; max-width: 250px; font-size: 12px; color: var(--dim); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
#menu .som .now:empty { display: none; }
#help, #credits { left: 50%; top: 50%; transform: translate(-50%, -50%); width: min(560px, calc(100% - 32px)); max-height: calc(100% - 24px); overflow: auto; padding: 18px 22px; }
#help h2, #credits h2 { font: 700 26px var(--title); color: var(--gold); margin: 0 0 8px; }
#help li { margin: 0 0 6px; color: var(--dim); }
#help li b { color: var(--ink); }
#credits { z-index: 8; }
#credits h3 { font: 700 15px var(--font); letter-spacing: 0.08em; text-transform: uppercase; color: var(--dim); margin: 14px 0 6px; }
#credits p { margin: 0 0 6px; color: var(--dim); font-size: 14px; }
#credits a { color: var(--gold); }
ul.cr { margin: 0 0 8px; padding-left: 18px; font-size: 13px; color: var(--dim); }
ul.cr li { margin: 0 0 6px; }
ul.cr.sm li { margin: 0 0 2px; }

#toasts { position: absolute; z-index: 7; top: 52px; left: 50%; transform: translateX(-50%); display: grid; gap: 6px; justify-items: center; }
.toast { background: rgba(20, 12, 10, 0.92); border: 1px solid #6b3a30; color: #ffd9d2; padding: 7px 14px; border-radius: 8px; animation: fade 4s forwards; }
.toast.info { background: rgba(14, 22, 12, 0.92); border-color: var(--line); color: var(--ink); }
.toast.alert { background: rgba(70, 14, 10, 0.95); border-color: #d6574a; color: #fff; font-weight: 700; animation: fade 7s forwards; }
.toast.click { pointer-events: auto; cursor: pointer; }
/* com a cidade ou os reinos abertos (painel largo no meio), os avisos vão para a direita e não cobrem o painel */
@media (min-width: 1240px) {
  #hud:has(.pop.wide:not([hidden])) #toasts { left: auto; right: 12px; transform: none; justify-items: end; max-width: calc(50% - 404px); }
}
@keyframes fade { 0%, 80% { opacity: 1; } 100% { opacity: 0; } }
/* a câmera presa (tarefa 36, follow.js): o aviso fica em cima dos que passam, enquanto a câmera segue alguém */
#follow { display: flex; align-items: center; gap: 10px; pointer-events: auto; padding: 4px 5px 4px 12px; border-radius: 8px; font-size: 14px;
  background: rgba(14, 22, 12, 0.92); border: 1px solid var(--gold2); color: var(--ink); box-shadow: 0 4px 14px rgba(0, 0, 0, 0.4); }
#follow[hidden] { display: none; }
#follow b { color: var(--gold); }
#follow .fw-k { color: var(--dim); }
#follow button { padding: 2px 10px; font-size: 13px; }
/* os andares de cima (tarefa 64, andares.js): o andar que a tela vê, na beira direita, no meio da altura */
#andar { position: absolute; z-index: 3; right: 12px; top: 50%; transform: translateY(-50%); display: grid; justify-items: center; gap: 4px; pointer-events: auto;
  padding: 6px 5px; border-radius: 8px; background: rgba(14, 22, 12, 0.88); border: 1px solid var(--line); box-shadow: 0 4px 14px rgba(0, 0, 0, 0.4); }
#andar[hidden], #hud.ug #andar { display: none; }
#andar b { color: var(--gold); font-size: 14px; white-space: nowrap; }
#andar button { width: 34px; height: 30px; padding: 0; font-size: 14px; line-height: 1; }
#andar button:disabled { opacity: 0.35; cursor: default; }
.gar.fl { color: var(--gold); }
@media (pointer: coarse) { #andar button { width: 44px; height: 44px; font-size: 18px; } }
/* o lembrete do e-mail da conta (tarefa 46, conta.js): fixo até o jogador escolher Cadastrar ou Depois */
#nag { display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 6px 10px; pointer-events: auto; padding: 5px 6px 5px 12px; border-radius: 8px;
  font-size: 14px; max-width: min(560px, calc(100vw - 24px)); background: rgba(14, 22, 12, 0.94); border: 1px solid var(--gold2); color: var(--ink); box-shadow: 0 4px 14px rgba(0, 0, 0, 0.4); }
#nag[hidden] { display: none; }
#nag button { padding: 2px 10px; font-size: 13px; }
/* Seguir, ao lado do nome da pessoa no painel da seleção */
.fw-b { display: inline-flex; align-items: center; gap: 3px; margin-left: 6px; padding: 1px 8px 1px 4px; font: 500 12.5px var(--font); vertical-align: 3px; }
.fw-b .ico { width: 17px; height: 17px; }
.fw-b.on { border-color: var(--gold); color: var(--gold); background: rgba(227, 185, 95, 0.14); }
/* botão dentro do texto do painel (tarefa 75: o Cercado mágico e o Bestiário do castelo) */
.inb { display: inline-flex; align-items: center; gap: 3px; margin-left: 6px; padding: 1px 8px 1px 4px; font: 500 12.5px var(--font); vertical-align: 1px; }
.inb .ico { width: 16px; height: 16px; }
.inb.on { border-color: var(--gold); color: var(--gold); background: rgba(227, 185, 95, 0.14); }
/* o Bestiário do castelo (tarefa 75): uma ficha por criatura; a já domada, em ouro */
.best { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 6px 14px; margin: 6px 0 8px; max-width: 760px; }
.best .bx { display: flex; gap: 8px; align-items: flex-start; opacity: 0.8; }
.best .bx.ok { opacity: 1; }
.best .bx > .ico { width: 30px; height: 30px; flex: none; }
.best b { display: block; font-size: 13.5px; }
.best .ok b { color: var(--gold); }
.best small { display: block; font-size: 12px; line-height: 1.25; color: var(--dim); }

#box { position: absolute; border: 1px solid #d9f0c0; background: rgba(160, 220, 120, 0.12); display: none; }
#labels { position: absolute; inset: 0; overflow: hidden; z-index: 0; }
.lbl { position: absolute; left: 0; top: 0; transform: translate(-50%, -100%); font: 700 13px var(--title); letter-spacing: 0.02em; white-space: nowrap; color: #fff; text-shadow: 0 1px 2px #000, 0 0 4px #000; }
.bar { position: absolute; left: 0; top: 0; transform: translate(-50%, -50%); width: 54px; height: 6px; background: rgba(0, 0, 0, 0.6); border: 1px solid rgba(0, 0, 0, 0.8); border-radius: 3px; overflow: hidden; }
.bar i { display: block; height: 100%; width: var(--p, 0%); background: var(--gold); }
.bar.hp { height: 5px; width: 60px; }
.bar.hp.sm { width: 30px; height: 4px; border-radius: 2px; }
.bar.hp.me i { background: #7fd36a; }
.bar.hp.ally i { background: #5aa7ff; }
.bar.hp.war i { background: #ff5a4a; }
.bar.hp.other i { background: #e8c34a; }
/* o dragão (tarefa 65): o fôlego embaixo da vida e o zZ do que dorme no ninho; tarefa 74: as duas barras maiores, o
   fôlego azul */
.bar.hp.dg { width: 64px; height: 6px; }
.bar.fo { width: 64px; height: 5px; border-radius: 3px; }
.bar.fo i { background: #3f8cff; }
.bar.mn { width: 30px; height: 3px; border-radius: 2px; }
.bar.mn i { background: #b48cff; }
.zz { position: absolute; left: 0; top: 0; font: italic 700 14px/1 Georgia, serif; color: #f1ead6; text-shadow: 0 1px 3px #000; pointer-events: none; animation: zz 2.4s ease-in-out infinite; }
.zz small { font-size: 10px; }
@keyframes zz { 0%, 100% { opacity: 0.35; } 50% { opacity: 1; } }
@media (prefers-reduced-motion: reduce) { .zz { animation: none; opacity: 0.8; } }
.lbl .gar { display: inline-flex; align-items: center; gap: 2px; font: 700 12px var(--font); background: rgba(0, 0, 0, 0.5); border-radius: 4px; padding: 0 4px; }
.lbl .gar .ico { width: 13px; height: 13px; }
.lbl.wl { font: 700 12px var(--font); background: rgba(0, 0, 0, 0.55); border-radius: 5px; padding: 1px 7px; }
.lbl.wl.bad { color: #ffc2b8; }
/* terrenos à venda (modo Expandir): o preço com os ícones; o do ponteiro por cima dos outros */
.lbl.plot { white-space: normal; max-width: 170px; text-align: center; line-height: 1.3; }
.lbl.plot.hot { z-index: 2; max-width: 250px; background: rgba(0, 0, 0, 0.75); }
.lbl .cost { display: inline-flex; gap: 6px; margin: 0; vertical-align: -3px; }
.lbl .cost .ico { width: 14px; height: 14px; }
.lbl .cost .no { color: #ff9b8c; }
/* contadores sobre o mapa: quanto falta (obra, fila, plantio, carga) e quanto resta no recurso; a barra embaixo enche */
.tmr { position: absolute; left: 0; top: 0; display: flex; align-items: center; gap: 3px; padding: 1px 6px 3px 4px; border-radius: 5px;
  background: rgba(8, 11, 7, 0.8); border: 1px solid rgba(0, 0, 0, 0.7); color: #fff; font: 700 12px/1.25 var(--font);
  font-variant-numeric: tabular-nums; white-space: nowrap; overflow: hidden; }
.tmr .ico { width: 14px; height: 14px; }
.tmr small { font-size: 10.5px; color: var(--dim); margin-left: 2px; }
.tmr::after { content: ''; position: absolute; left: 0; bottom: 0; height: 2px; width: var(--p, 0%); background: var(--gold); }
.tmr.u { padding: 0 4px 2px; font-size: 11px; }
.tmr.stop { color: #ffc2b8; }
.tmr.stop::after { background: #d6574a; }
.tmr.node::after { background: #d9dfe3; }

/* topo: era, proteção, guerra e o botão dos reinos */
#status { display: flex; gap: 6px; align-items: center; margin-right: auto; white-space: nowrap; }
#status .chip { padding: 3px 8px; font-size: 13px; cursor: default; }
#status .chip b { font-variant-numeric: tabular-nums; }
#status .chip .long { color: var(--dim); margin-left: 2px; }
#status .chip.prot { border-color: #2f6fb8; background: rgba(47, 111, 184, 0.18); }
#status .chip.rit { border-color: #c9a14b; background: rgba(201, 161, 75, 0.2); color: #f6e3b0; }   /* o ritmo do reino (tarefa 32) */
#status .chip.dgh { border-color: #d6574a; background: rgba(214, 87, 74, 0.2); color: #ffc2b8; }   /* os dragões com fome (tarefa 65) */
#status button.chip.vas { cursor: pointer; border-color: #c9961f; background: rgba(201, 150, 31, 0.2); color: #f6e3b0; }
#status button.chip.war { cursor: pointer; border-color: #d6574a; background: rgba(214, 87, 74, 0.25); color: #ffd9d2; animation: pulse 1.6s infinite; }
@keyframes pulse { 50% { box-shadow: 0 0 0 3px rgba(214, 87, 74, 0.25); } }
#r-realms { padding: 3px 10px; position: relative; }
/* quem está online (tarefa 55): o contador do topo, a bolinha de cada reino na lista dos reinos, o selo dos bots, o
   "visto há" (escrito só nas telas sem mouse: no computador, fica na dica) e o filtro Só online */
#r-online { display: inline-flex; align-items: center; gap: 5px; padding: 3px 10px; font-variant-numeric: tabular-nums; }
#r-online .tx { color: var(--dim); }
.odot { display: inline-block; flex: none; width: 9px; height: 9px; border-radius: 50%; background: #6b7266; border: 1px solid rgba(0, 0, 0, 0.5); vertical-align: 1px; }
.odot.on { background: var(--good); box-shadow: 0 0 5px rgba(143, 210, 106, 0.7); }
table.rank td.nm .odot { margin-right: 6px; }
table.rank .bt { margin-left: 6px; padding: 0 5px; border: 1px solid var(--line); border-radius: 4px; color: var(--dim); font-size: 12px; font-weight: 600; vertical-align: 1px; }
table.rank .seen { display: none; margin-left: 6px; color: var(--dim); font-size: 12px; font-weight: 400; }
@media (hover: none) { table.rank .seen { display: inline; } }
@media (hover: none) and (max-width: 520px) { #realms table.rank td.nm .seen { display: block; margin: 1px 0 0 15px; } }
.onbar { display: flex; align-items: center; flex-wrap: wrap; gap: 6px 10px; margin: 0 0 6px; }
.onbar button { display: inline-flex; align-items: center; gap: 6px; padding: 3px 10px; font-size: 13px; }
.onbar button.on { border-color: var(--good); color: var(--good); background: rgba(143, 210, 106, 0.12); }
.onbar .t { color: var(--dim); font-size: 12.5px; }
#r-map { padding: 3px 10px; }
#r-map.on { border-color: var(--gold); color: var(--gold); }
/* painel do povo (P): na lateral esquerda, entre o topo e o bate-papo, sem cobrir o painel de baixo nem o mapinha; o
   bate-papo vai para o lado enquanto ele está aberto */
#r-povo { padding: 3px 10px; display: inline-flex; align-items: center; gap: 5px; }
#r-povo b { color: var(--dim); font-variant-numeric: tabular-nums; }
#r-povo i { font-style: normal; font-size: 11px; font-weight: 700; min-width: 17px; padding: 0 4px; border-radius: 9px; background: var(--gold); color: #1d1606; line-height: 17px; text-align: center; }
#r-povo.on { border-color: var(--gold); color: var(--gold); }
#povo { left: 10px; top: 48px; width: 318px; max-height: calc(100% - 262px); display: flex; flex-direction: column; gap: 6px; padding: 8px; }
#hud:has(#povo:not([hidden])) #chat { left: 338px; width: min(440px, calc(100% - 348px)); }
/* a orelhinha (tarefa 45): o painel fechado vira uma aba colada na borda esquerda, na altura do título dele. Fica
   embaixo do balão do tutorial e dos painéis (z-index) e some, como o painel, no subsolo e no mapa do mundo */
#pv-tab { position: absolute; z-index: 4; left: 0; top: 48px; width: 28px; display: flex; flex-direction: column; align-items: center; gap: 6px;
  padding: 8px 0 9px; color: var(--gold); background: var(--panel); border: 1px solid var(--line); border-left: 0; border-radius: 0 9px 9px 0;
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.45); }
#pv-tab[hidden], #hud:has(#wmap:not([hidden])) #pv-tab { display: none; }
#pv-tab:hover { border-color: var(--gold); background: var(--panel2); }
#pv-tab .ico { width: 18px; height: 18px; }
#pv-tab .pt-t { writing-mode: vertical-rl; transform: rotate(180deg); font: 700 16px/1 var(--title); letter-spacing: 0.03em; }
#pv-tab i { font-style: normal; font-size: 11px; font-weight: 700; min-width: 20px; padding: 0 3px; border-radius: 9px; background: var(--gold); color: #1d1606; line-height: 17px; text-align: center; }
#pv-tab i[hidden] { display: none; }
.pv-top { display: flex; align-items: center; gap: 8px; }
.pv-top > b { font: 700 19px var(--title); color: var(--gold); }
.pv-tot { flex: 1; min-width: 0; color: var(--dim); font-size: 13px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pv-f, .pv-x { padding: 2px 8px; font-size: 13px; }
.pv-f.on { border-color: var(--gold); color: var(--gold); }
.pv-list { flex: 1 1 auto; min-height: 60px; overflow: auto; display: grid; gap: 4px; align-content: start; }
.pv-empty { margin: 8px 4px; color: var(--dim); font-size: 14px; }
.pv-g { border: 1px solid var(--line); border-radius: 8px; background: rgba(255, 255, 255, 0.025); }
.pv-g.sub { border: 0; border-top: 1px solid rgba(255, 255, 255, 0.06); border-radius: 0; background: none; }
.pv-h { display: flex; align-items: center; gap: 4px; padding: 2px 4px 2px 2px; }
.pv-g.sub .pv-h { padding-left: 12px; }
.pv-hb { flex: 1; min-width: 0; display: flex; align-items: center; gap: 6px; padding: 3px 4px; background: none; border: 0; text-align: left; }
.pv-hb:hover:not(:disabled) { background: rgba(255, 255, 255, 0.05); }
.pv-tw { width: 10px; flex: none; color: var(--dim); font-size: 11px; transition: transform 0.15s; }
.pv-g.open > .pv-h .pv-tw { transform: rotate(90deg); }
.pv-ic { display: inline-flex; flex: none; }
.pv-gn { font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pv-c { color: var(--dim); font-variant-numeric: tabular-nums; }
.pv-gi { margin-left: auto; color: var(--gold); font-size: 12.5px; font-weight: 700; white-space: nowrap; }
.pv-gh { color: var(--dim); font-size: 12px; white-space: nowrap; }
.pv-gi:empty, .pv-gh:empty { display: none; }
.pv-gi:empty + .pv-gh { margin-left: auto; }
.pv-eye { flex: none; padding: 2px 5px; background: none; line-height: 0; }
.pv-ck { position: relative; flex: none; width: 20px; height: 20px; padding: 0; border-radius: 4px; background: #0b100a; }
.pv-ck[aria-checked="true"]::after { content: '✓'; position: absolute; inset: 0; display: grid; place-items: center; color: var(--gold); font-weight: 700; font-size: 14px; line-height: 1; }
.pv-ck[aria-checked="mixed"]::after { content: ''; position: absolute; left: 4px; right: 4px; top: 8px; height: 2px; background: var(--gold); }
.pv-rows { display: grid; }
.pv-rows:empty { display: none; }
.pv-r { display: grid; grid-template-columns: 20px 20px minmax(0, 1fr) auto 24px; column-gap: 6px; align-items: center; padding: 3px 6px; cursor: pointer; border-top: 1px solid rgba(255, 255, 255, 0.04); }
.pv-g.sub .pv-r { padding-left: 14px; }
.pv-r:hover { background: rgba(255, 255, 255, 0.05); }
.pv-r.on { background: rgba(227, 185, 95, 0.13); }
.pv-r > .pv-ck { grid-row: 1 / span 2; grid-column: 1; }
.pv-r > .pv-ic { grid-row: 1 / span 2; grid-column: 2; }
.pv-nm { grid-column: 3; min-width: 0; font-size: 14px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pv-nm small { margin-left: 5px; color: var(--dim); font-size: 12px; }
.pv-st { grid-column: 4; display: flex; gap: 6px; font-size: 12px; font-variant-numeric: tabular-nums; }
.pv-hp { color: var(--good); }
.pv-hp.low { color: var(--bad); }
.pv-q { color: var(--gold); }
.pv-do { grid-column: 3 / span 2; color: var(--dim); font-size: 12.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pv-r.idle .pv-do { color: var(--gold); font-weight: 700; }
.pv-more { margin: 4px 8px 6px; color: var(--dim); font-size: 12.5px; }
.pv-foot { display: grid; gap: 5px; padding-top: 6px; border-top: 1px solid var(--line); }
.pv-sel { display: flex; align-items: center; justify-content: space-between; gap: 8px; font-size: 13px; color: var(--dim); }
.pv-cl { padding: 1px 8px; font-size: 12.5px; }
.pv-acts { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 4px; }
.pv-acts button { display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 4px 2px; font-size: 12px; }
.pv-hint { margin: 0; color: var(--dim); font-size: 11.5px; line-height: 1.3; }
/* a câmera da linha (tarefa 36): prende a câmera na pessoa; acesa enquanto a câmera a segue */
.pv-fw { grid-row: 1 / span 2; grid-column: 5; padding: 2px; background: none; border: 0; line-height: 0; opacity: 0.4; }
.pv-r:hover .pv-fw, .pv-fw:focus-visible { opacity: 1; }
.pv-r.fw { box-shadow: inset 3px 0 0 var(--gold); }
.pv-r.fw .pv-fw { opacity: 1; filter: drop-shadow(0 0 4px var(--gold)); }
/* mapa do mundo (N) */
#wmap { position: absolute; z-index: 8; inset: 50px 12px 12px; display: flex; flex-direction: column; background: rgba(6, 10, 13, 0.97);
  border: 1px solid var(--line); border-radius: 10px; overflow: hidden; box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5); }
#wm-top { display: flex; align-items: center; gap: 12px; padding: 5px 8px 5px 12px; border-bottom: 1px solid var(--line); }
#wm-top b { font: 700 18px var(--title); color: var(--gold); white-space: nowrap; }
#wm-where { flex: 1; min-width: 0; color: var(--dim); font-size: 14px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
#wm-close { padding: 2px 10px; }
/* as abas Mundo e Mundo Mágico (tarefa 71) */
#wm-tabs { flex: none; margin: 0; }
#wm-tabs[hidden] { display: none; }
#wm-tabs button[data-zn="1"].on { border-color: #9b7fe0; color: #cdb6ff; }
#wm-cv { flex: 1; min-height: 0; width: 100%; display: block; cursor: crosshair; touch-action: none; }
#wm-help { margin: 0; padding: 4px 12px 6px; font-size: 12.5px; color: var(--dim); border-top: 1px solid var(--line); }
/* nome da região em que a câmera entrou */
#banner { position: absolute; z-index: 3; top: 16%; left: 50%; transform: translate(-50%, -8px); text-align: center; pointer-events: none;
  opacity: 0; transition: opacity 0.7s, transform 0.7s; max-width: calc(100% - 32px); }
#banner.on { opacity: 1; transform: translate(-50%, 0); }
#banner b { display: block; font: 700 32px/1.1 var(--title); color: var(--gold); text-shadow: 0 2px 6px #000, 0 0 14px rgba(0, 0, 0, 0.8); }
#banner small { display: block; margin-top: 2px; font-size: 14.5px; color: #efe6cf; text-shadow: 0 1px 3px #000, 0 0 6px #000; }
/* cidade: a reputação no topo e o painel (C) */
#status button.chip.city { cursor: pointer; }
#status .chip.city.low { border-color: #d6574a; color: #ffd9d2; }
#status .chip.city.warn::after { content: ''; width: 7px; height: 7px; border-radius: 50%; background: var(--bad); }
#city { left: 50%; top: 52px; transform: translateX(-50%); width: min(780px, calc(100% - 32px)); max-height: calc(100% - 270px); min-height: 200px; display: flex; flex-direction: column; padding: 12px 14px; }
#city[hidden] { display: none; }
#city h4 { margin: 12px 0 4px; font: 700 12px var(--font); letter-spacing: 0.08em; text-transform: uppercase; color: var(--dim); }
#city .cols { display: grid; grid-template-columns: minmax(0, 1.5fr) minmax(0, 1fr); gap: 0 26px; }
#city .warn { margin: 3px 0 0; }
.repbox { display: flex; align-items: center; gap: 14px; }
.repbox .rv { font: 700 38px/1 var(--title); color: var(--gold); font-variant-numeric: tabular-nums; min-width: 1.6em; text-align: center; }
.repbox .rl { display: grid; gap: 3px; flex: 1; min-width: 0; }
.repbox .meter { height: 8px; }
.repbox small { color: var(--dim); font-size: 12.5px; }
.cbar { display: grid; grid-template-columns: 70px 1fr 30px; gap: 8px; align-items: center; font-size: 13px; margin: 2px 0; max-width: 420px; }
.cbar .meter { height: 7px; }
.cbar b { text-align: right; font-variant-numeric: tabular-nums; }
/* civil selecionado: barras à esquerda, números e avisos à direita */
.civ { display: grid; grid-template-columns: minmax(0, 330px) minmax(0, 1fr); gap: 0 24px; align-items: start; }
.civ .cbar { margin: 1px 0; }
.civ .facts { grid-template-columns: repeat(2, minmax(0, 1fr)); margin-top: 2px; }
.civ p { margin: 2px 0; }
.meter i.low { background: linear-gradient(90deg, #a8382c, #d6574a); }
.meter i.mid { background: linear-gradient(90deg, var(--gold2), var(--gold)); }
.meter i.high { background: linear-gradient(90deg, #4f8a35, #8fd26a); }
/* a vida e o fôlego do dragão no painel (tarefa 74) */
.meter i.hp { background: linear-gradient(90deg, #a8382c, #ff5a4a); }
.meter i.fo { background: linear-gradient(90deg, #2a62c9, #4f9dff); }
/* Como domar um dragão, no Dragonário (tarefa 74) */
.how { margin: 8px 0 2px; font-size: 13.5px; color: var(--dim); }
.how > b { color: var(--ink); }
.how ol { margin: 3px 0 0; padding-left: 20px; }
.how li { margin: 2px 0; }
.ctl { display: flex; flex-wrap: wrap; gap: 6px 8px; align-items: center; margin: 6px 0; font-size: 13.5px; }
.ctl .lb { color: var(--dim); min-width: 112px; }
.ctl button { padding: 4px 10px; font-size: 13px; }
.ctl button.on { border-color: var(--gold); color: var(--gold); }
.ctl .note { margin: 0; }
.who { display: flex; flex-wrap: wrap; gap: 4px; align-items: center; margin: 4px 0; }
.who .sub { margin: 0 2px 0 0; }
.who button { padding: 1px 7px; font-size: 12.5px; }
table.rank.houses td, table.rank.houses th { font-size: 13px; }
#r-realms.ask::after { content: ''; position: absolute; top: -3px; right: -3px; width: 10px; height: 10px; border-radius: 50%; background: var(--bad); border: 2px solid #111; }

/* ficha da tropa */
.stats { display: grid; grid-template-columns: repeat(2, minmax(0, max-content)); gap: 2px 18px; font-size: 13px; color: var(--dim); margin: 2px 0 4px; }
.stats b { color: var(--ink); font-variant-numeric: tabular-nums; }

/* painel dos reinos */
#realms { left: 50%; top: 52px; transform: translateX(-50%); width: min(780px, calc(100% - 32px)); max-height: calc(100% - 270px); min-height: 200px; display: flex; flex-direction: column; padding: 12px 14px; }
#realms[hidden] { display: none; }
/* painel dos bots (menu Esc, só a conta administradora) */
#bots { left: 50%; top: 52px; transform: translateX(-50%); width: min(720px, calc(100% - 32px)); max-height: calc(100% - 120px); display: flex; flex-direction: column; padding: 12px 14px; }
#bots[hidden] { display: none; }
/* descontos (tarefa 19): o painel do administrador e a faixa do evento, embaixo da barra do topo */
/* Eventos (tarefa 50; antes, os descontos): a lista dos ligados e o formulário, um atributo por linha (o x, os de um
   clique, o recurso e, ligado, o equivalente em % embaixo) */
#disc { left: 50%; top: 52px; transform: translateX(-50%); width: min(640px, calc(100% - 32px)); max-height: calc(100% - 120px); overflow: auto; padding: 12px 14px; }
#disc[hidden] { display: none; }
#disc .phead h2 { margin-right: auto; }
#disc .state { margin: 0 0 6px; color: var(--dim); }
#disc .dl { list-style: none; margin: 0 0 8px; padding: 0; display: grid; gap: 6px; }
#disc .dl li { display: flex; align-items: center; gap: 10px; padding: 6px 10px; border: 1px solid #8a6a1c; border-radius: 8px; background: rgba(242, 193, 78, 0.08); }
#disc .dl .dt { margin-right: auto; font-weight: 700; color: var(--gold); }
#disc .dl small { display: block; font-weight: 400; color: var(--dim); font-size: 12.5px; }
#disc .df { border-top: 1px solid var(--line); padding-top: 6px; }
#disc .df h3 { margin: 2px 0 2px; font: 700 16px var(--title); color: var(--gold); }
#disc .ctl .lb { min-width: 96px; }
#disc #e-name { flex: 1 1 180px; }
#disc .hint { margin: 4px 0; font-size: 12.5px; color: var(--dim); }
#disc .attrs { display: grid; gap: 4px; margin: 6px 0; }
#disc .at { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 6px; padding: 4px 8px; border: 1px solid var(--line); border-radius: 8px; font-size: 13.5px; }
#disc .at.on { border-color: #8a6a1c; background: rgba(242, 193, 78, 0.08); }
#disc .at .an { flex: 1 1 160px; }
#disc .at.on .an { color: var(--gold); font-weight: 700; }
#disc .xf { color: var(--dim); white-space: nowrap; }
#disc .ex { width: 54px; margin-left: 2px; text-align: right; }
#disc .xq { padding: 3px 7px; font-size: 12.5px; }
#disc .xq.on { border-color: var(--gold); color: var(--gold); }
#disc .at select { font-size: 12.5px; }
#disc .eq { flex: 1 0 100%; font-size: 12px; color: #ffe9b0; }
#disc .eq:not(.on) { display: none; }
#disc .prev { margin: 8px 0 4px; font-size: 13.5px; color: var(--dim); }
#disc .prev b { color: var(--gold); }
#disc .prev .bad, #disc .err { color: var(--bad); }
#disc > .note { margin-top: 10px; }
/* recursos que se renovam (tarefa 29): o painel do administrador, como o dos descontos */
#renew { left: 50%; top: 52px; transform: translateX(-50%); width: min(560px, calc(100% - 32px)); max-height: calc(100% - 120px); overflow: auto; padding: 12px 14px; }
#renew[hidden] { display: none; }
#renew .phead h2 { margin-right: auto; }
#renew .state { margin: 0 0 6px; color: var(--dim); }
#renew dl.rn { display: grid; grid-template-columns: max-content 1fr; gap: 4px 12px; margin: 0 0 10px; }
#renew dl.rn dt { color: var(--dim); }
#renew dl.rn dd { margin: 0; }
#renew dl.rn b { color: var(--gold); }
#renew .dl { list-style: none; margin: 0 0 10px; padding: 0; display: grid; gap: 6px; }
#renew .dl li { display: flex; align-items: center; gap: 10px; padding: 6px 10px; border: 1px solid #8a6a1c; border-radius: 8px; background: rgba(242, 193, 78, 0.08); }
#renew .dl .dt { margin-right: auto; font-weight: 700; color: var(--gold); }
#renew .dl small { display: block; font-weight: 400; color: var(--dim); font-size: 12.5px; }
#renew .ctl .note { color: var(--dim); font-size: 13px; }
#renew .err { color: var(--bad); }
/* o painel Ritmo (tarefa 32, só o administrador) */
#rit { left: 50%; top: 52px; transform: translateX(-50%); width: min(560px, calc(100% - 32px)); max-height: calc(100% - 120px); overflow: auto; padding: 12px 14px; }
#rit[hidden] { display: none; }
#rit .phead h2 { margin-right: auto; }
#rit .state { margin: 0 0 8px; color: var(--dim); font-size: 13.5px; }
#rit .dl { list-style: none; margin: 0 0 8px; padding: 0; display: grid; gap: 6px; max-height: 260px; overflow: auto; }
#rit .dl li { display: flex; align-items: center; gap: 8px; padding: 6px 10px; border: 1px solid var(--line); border-radius: 8px; }
#rit .dl li.on { border-color: #8a6a1c; background: rgba(242, 193, 78, 0.08); }
#rit .dl li.sel { outline: 2px solid var(--gold); outline-offset: -2px; }
#rit .dl .dt { margin-right: auto; font-weight: 700; }
#rit .dl li.on .dt { color: var(--gold); }
#rit .dl .dt i { font-style: normal; font-weight: 400; font-size: 12px; color: var(--dim); border: 1px solid var(--line); border-radius: 4px; padding: 0 4px; margin-left: 4px; }
#rit .dl small { display: block; font-weight: 400; color: var(--dim); font-size: 12.5px; }
#rit .dl small b { color: var(--gold); }
#rit .df { border-top: 1px solid var(--line); padding-top: 6px; }
#rit .ctl .lb { min-width: 72px; }
#rit #r-x { width: 56px; }
#rit .prev { margin: 8px 0 4px; font-size: 13.5px; color: var(--dim); }
#rit .prev b { color: var(--gold); }
#rit .prev .bad, #rit .err { color: var(--bad); }
#rit > .note { margin-top: 10px; color: var(--dim); font-size: 13px; }
#rit h3 { margin: 10px 0 6px; font: 700 16px var(--title); color: var(--gold); }
/* o ritmo de iniciante (tarefa 43) */
#rit .nov { margin: 0 0 6px; padding: 6px 10px 8px; border: 1px solid #8a6a1c; border-radius: 8px; background: rgba(242, 193, 78, 0.05); }
#rit .nov h3 { margin-top: 0; }
#rit .nov .cnt { margin: 0 0 4px; font-size: 13.5px; color: var(--dim); }
#rit .nov .cnt b { color: var(--gold); }
#rit .nov .ctl .lb { min-width: 132px; }
#rit #n-x { width: 56px; }
#rit .nov input:disabled, #rit .nov select:disabled { opacity: 0.45; }
#rit .nov .prev i { font-style: normal; font-size: 12.5px; color: var(--dim); opacity: 0.85; }
#rit .nov .hint { margin: 4px 0 0; color: var(--dim); font-size: 12.5px; }
#rit .nov .ok { margin: 6px 0 0; color: var(--good); font-size: 13.5px; }
#rit .nov .err { margin: 6px 0 0; }
/* o balanceamento do administrador (tarefa 51, balanco.js): quase a tela toda; a lista à esquerda e as contas ("ver o
   efeito") à direita; embaixo, o que está pendente e o Aplicar. Mudado do padrão: dourado; pendente: azul. */
#tun { inset: 52px 24px 20px; display: flex; flex-direction: column; padding: 12px 14px; overflow: hidden; }
#tun[hidden] { display: none; }
#tun .phead h2 { margin-right: auto; }
#tun .phead button:not(.x) { padding: 4px 10px; font-size: 13px; }
#tun .tn-top { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 10px; margin: 0 0 6px; }
#tun #tn-q { flex: 1 1 260px; width: auto; max-width: 420px; padding: 6px 10px; }
#tun .tn-top .cnt { margin-right: auto; color: var(--dim); font-size: 13px; }
#tun .tn-top .cnt b { color: var(--gold); }
#tun .tn-top button { padding: 4px 10px; font-size: 13px; }
#tun .tn-top button.on, #tun .hl button.on { border-color: var(--bad); color: var(--bad); }
#tun .tabs.sub { flex: none; margin: 0 0 6px; }
#tun .tabs .pd { font-style: normal; color: #7fb8ff; margin-left: 3px; }
#tun :is(.hint, .ok, .err) { flex: none; margin: 0 0 6px; font-size: 13px; }
#tun .hint { color: var(--dim); }
#tun .ok { color: var(--good); }
#tun .err { color: var(--bad); }
#tun .tn-body { flex: 1 1 auto; min-height: 0; display: grid; grid-template-columns: minmax(0, 1fr) minmax(240px, 32%); gap: 12px; }
#tun .tn-list { overflow: auto; min-height: 0; padding-right: 4px; overscroll-behavior: contain; }
#tun .tn-eff { overflow: auto; min-height: 0; border-left: 1px solid var(--line); padding-left: 12px; font-size: 13.5px; overscroll-behavior: contain; }
#tun .tn-eff h3 { margin: 0 0 6px; font: 700 16px var(--title); color: var(--gold); }
#tun .tn-eff h3 small { display: block; font: 400 12px var(--font); color: var(--dim); }
#tun .tn-eff ul { margin: 0; padding-left: 16px; display: grid; gap: 6px; }
#tun .tn-eff li.chg .o { display: block; color: var(--dim); text-decoration: line-through; opacity: 0.8; }
#tun .tn-eff li.chg .n { display: block; color: #a9d0ff; }
#tun .tn-eff .note { margin: 8px 0 0; color: var(--dim); font-size: 12px; }
/* sem contas (o Histórico): a coluna do efeito sai e a lista fica com a largura (e, no celular, a altura) toda */
#tun .tn-eff:empty { display: none; }
#tun .tn-body:has(> .tn-eff:empty) { grid-template-columns: minmax(0, 1fr); grid-template-rows: minmax(0, 1fr); }
#tun .info { margin: 0 0 6px; color: var(--dim); font-size: 13px; }
#tun .info button { margin-left: 6px; padding: 2px 8px; font-size: 12px; }
#tun details.tg { margin: 0 0 6px; padding: 0 8px; border: 1px solid var(--line); border-radius: 8px; }
#tun details.tg > summary { padding: 6px 0; font-weight: 700; cursor: pointer; }
#tun details.tg > summary small { font-weight: 400; color: var(--dim); }
#tun details.tg > summary i { margin-left: 6px; padding: 0 5px; border-radius: 4px; font-style: normal; font-weight: 400; font-size: 12px; }
#tun details.tg > summary i.m { color: var(--gold); border: 1px solid #8a6a1c; }
#tun details.tg > summary i.p { color: #7fb8ff; border: 1px solid #3c5f86; }
#tun .tr { display: grid; grid-template-columns: minmax(150px, 1fr) 124px minmax(150px, 220px) 104px 30px; align-items: center; gap: 2px 8px; padding: 4px 0;
  border-top: 1px solid rgba(255, 255, 255, 0.05); font-size: 13.5px; }
#tun .tr .nm small { display: block; color: var(--dim); font-size: 12px; }
#tun .tr .pd { color: var(--dim); font-size: 12.5px; white-space: nowrap; }
#tun .tr .vl { display: flex; align-items: center; gap: 6px; }
#tun .tr input { width: 104px; padding: 4px 6px; }
#tun .tr .un { color: var(--dim); font-size: 12px; white-space: nowrap; }
#tun .tr .vw { color: var(--dim); font-size: 12.5px; }
#tun .tr .rs { padding: 2px 6px; font-size: 13px; }
#tun .tr :is(.was, .msg) { grid-column: 1 / -1; font-size: 12px; }
#tun .tr :is(.was, .msg):empty { display: none; }
#tun .tr .was { color: #7fb8ff; }
#tun .tr .msg { color: var(--bad); }
#tun .tr.mud input { border-color: var(--gold2); color: var(--gold); }
#tun .tr.pend { background: rgba(127, 184, 255, 0.07); }
#tun .tr.pend input { border-color: #7fb8ff; color: #cfe4ff; }
#tun .tr.bad input { border-color: var(--bad); }
#tun .tn-foot { flex: none; display: flex; flex-wrap: wrap; align-items: center; gap: 6px 8px; margin-top: 8px; padding-top: 8px; border-top: 1px solid var(--line); font-size: 13.5px; }
#tun .tn-foot:empty { display: none; }
#tun .tn-foot .st { margin-right: auto; color: var(--dim); }
#tun .tn-foot .st b { color: #7fb8ff; }
#tun .tn-foot .bad { color: var(--bad); }
#tun .tn-conf { flex: 1 1 auto; min-height: 0; overflow: auto; }
#tun .tn-conf h3 { margin: 4px 0 6px; font: 700 18px var(--title); color: var(--gold); }
#tun .tn-conf .cl { margin: 0 0 8px; padding-left: 18px; max-height: 50vh; overflow: auto; font-size: 13.5px; }
#tun :is(.tn-conf .cl, .hl) b { color: var(--gold); }
#tun :is(.tn-conf, .hl) i { color: var(--dim); }
#tun .hl { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
#tun .hl .he { padding: 6px 10px; border: 1px solid var(--line); border-radius: 8px; }
#tun .hl .he.gone { opacity: 0.6; }
#tun .hl .hh { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 8px; font-size: 13.5px; }
#tun .hl .hh :is(button, small) { margin-left: auto; }
#tun .hl .hh button { padding: 3px 10px; font-size: 13px; }
#tun .hl .hh small { color: var(--dim); }
#tun .hl ul { margin: 4px 0 0; padding-left: 18px; color: var(--dim); font-size: 13px; }
#tun .nv { font-size: 14px; }
#tun .nv b { color: var(--gold); }
#tun .nv small { color: var(--dim); }
/* o brasão do reino (tarefa 37, brasao.js): a escolha (tela de fundar e painel do menu) e o painel */
.flab { margin: 0 0 6px; color: var(--dim); font-size: 13px; }
.cpick { margin: 0 0 8px; }
.cp-top { display: flex; align-items: center; gap: 12px; margin-bottom: 8px; }
.cp-top .crest { margin: 0; filter: drop-shadow(0 3px 6px rgba(0, 0, 0, 0.5)); }
.cp-nm { margin: 0 auto 0 0; display: grid; line-height: 1.25; }
.cp-nm b { font: 700 21px var(--title); color: var(--gold); }
.cp-nm small { color: var(--dim); font-size: 12.5px; }
.cp-sh { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 6px; margin-bottom: 8px; }
.cp-sh button { display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 4px 2px 3px; font-size: 12px; line-height: 1.1; min-width: 0; }
.cp-sh button span { max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cp-sym { display: grid; grid-template-columns: repeat(auto-fill, minmax(38px, 1fr)); gap: 4px; }
.cp-sym button { padding: 3px 0; display: grid; place-items: center; }
.cpick button .crest { margin: 0; vertical-align: 0; }
.cpick button[aria-pressed="true"] { border-color: var(--gold); background: rgba(227, 185, 95, 0.18); box-shadow: inset 0 0 0 1px var(--gold); }
#crestp { left: 50%; top: 52px; transform: translateX(-50%); width: min(460px, calc(100% - 32px)); max-height: calc(100% - 120px); overflow: auto; padding: 12px 14px; }
#crestp .phead h2 { margin-right: auto; }
#crestp .state { margin: 0 0 8px; color: var(--dim); font-size: 13.5px; }
#crestp .now { margin: 0 0 10px; font-size: 14px; }
#crestp .now .crest { vertical-align: -6px; margin-right: 3px; }
#crestp .now b { color: var(--gold); }
#crestp .note.ok { color: var(--good); }
/* o painel Conta (tarefa 46, conta.js) e o painel Contas do administrador (contas.js) */
#conta, #contas { left: 50%; top: 52px; transform: translateX(-50%); width: min(440px, calc(100% - 32px)); max-height: calc(100% - 120px); overflow: auto; padding: 12px 14px; }
#contas { width: min(660px, calc(100% - 32px)); }
#conta .phead h2, #contas .phead h2 { margin-right: auto; }
#conta .state, #contas .state { margin: 0 0 8px; color: var(--dim); font-size: 13.5px; }
#conta .state b { color: var(--ink); }
#conta h3 { margin: 12px 0 6px; font: 700 16px var(--title); color: var(--gold); }
#conta label { display: block; margin: 0 0 8px; color: var(--dim); font-size: 13px; }
#conta label input { margin-top: 3px; padding: 6px 9px; }
#conta form { margin: 6px 0 0; }
#conta .row { margin-top: 2px; }
#conta .ct-st { margin: 0 0 4px; font-size: 14px; overflow-wrap: anywhere; }
#conta .ct-st b { color: var(--ink); }
#conta .ct-mail .note { margin: 0 0 6px; }
#conta .ok, #contas .ok { color: var(--good); }
#conta .bad, #contas .bad { color: var(--bad); }
#conta > .note { margin-top: 6px; }
#conta p.err:empty, #contas p.err:empty { min-height: 0; margin: 0; }
#contas .cs-f { display: flex; gap: 8px; margin: 0 0 6px; }
#contas .cs-f input { flex: 1; padding: 6px 9px; }
#contas .cs-l { list-style: none; margin: 8px 0 0; padding: 0; display: grid; gap: 6px; }
#contas .cs-l li { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 10px; padding: 7px 10px; border: 1px solid var(--line); border-radius: 8px; }
#contas .cs-l li.cs-none { color: var(--dim); justify-content: center; border-style: dashed; }
#contas .cs-who { flex: 1 1 260px; min-width: 0; }
#contas .cs-who b { font-size: 15px; }
#contas .cs-who i { font-style: normal; font-size: 12px; border: 1px solid var(--line); border-radius: 4px; padding: 0 5px; margin-left: 6px; color: var(--dim); }
#contas .cs-who i.warn { color: var(--gold); border-color: var(--gold2); }
#contas .cs-who i.vip { color: #cdb6ff; border-color: #7a5ec4; }
#contas .cs-act button.on { border-color: #7a5ec4; color: #cdb6ff; }
#contas .cs-who i.bad { color: var(--bad); border-color: #6b3a30; }
#contas .cs-who small { display: block; color: var(--dim); font-size: 12.5px; overflow-wrap: anywhere; }
#contas .cs-act { display: flex; gap: 6px; }
#contas .cs-l button { padding: 4px 10px; font-size: 13px; }
#contas .cs-ask { flex: 1 1 100%; font-size: 13.5px; padding: 6px 8px; border-radius: 6px; background: rgba(255, 122, 107, 0.07); }
#contas .cs-ed { flex: 1 1 100%; display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
#contas .cs-ed input { flex: 1 1 220px; padding: 5px 8px; }
#contas .cs-ed .note { flex: 1 1 100%; margin: 0; }
#contas .cs-tmp { margin: 0 0 6px; padding: 8px 12px; border: 1px solid var(--gold2); border-radius: 8px; background: rgba(227, 185, 95, 0.08); }
#contas .cs-tmp p { margin: 0 0 4px; }
#contas .cs-tmp .note { margin: 4px 0 0; }
#contas .cs-pass { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; }
#contas .cs-pass code { font: 700 21px ui-monospace, Consolas, monospace; letter-spacing: 0.08em; color: var(--gold); -webkit-user-select: all; user-select: all; }
#contas .cs-pass button { padding: 3px 10px; font-size: 13px; }
#contas .cs-on { margin: 0 0 10px; padding-bottom: 8px; border-bottom: 1px solid var(--line); }
#contas .cs-on h3 { margin: 0 0 4px; font: 700 16px var(--title); color: var(--gold); }
#contas .cs-on .note { margin: 0 0 6px; }
#contas .cs-onl { list-style: none; margin: 0; padding: 0; display: grid; gap: 4px; max-height: 168px; overflow: auto; }
#contas .cs-onl li { display: flex; flex-wrap: wrap; align-items: baseline; gap: 2px 10px; padding: 4px 10px; border-left: 3px solid var(--good); background: rgba(143, 210, 106, 0.06); border-radius: 4px; }
#contas .cs-onl span { color: var(--ink); }
#contas .cs-onl i { font-style: normal; color: var(--dim); }
#contas .cs-onl small { margin-left: auto; color: var(--dim); font-size: 12.5px; }
#contas .cs-mail { margin-top: 12px; padding-top: 8px; border-top: 1px solid var(--line); }
#contas .cs-mail h3 { margin: 0 0 4px; font: 700 16px var(--title); color: var(--gold); }
#contas .cs-mail .note { margin: 0 0 6px; overflow-wrap: anywhere; }
#contas .cs-mail #cs-mtm { margin: 0; overflow-wrap: anywhere; }
/* a faixa do evento (tarefa 50: clicável, abre o quadro com a lista completa) */
#event { position: absolute; z-index: 3; top: 46px; left: 50%; transform: translateX(-50%); width: max-content; max-width: calc(100% - 32px); cursor: pointer;
  padding: 5px 16px; border: 1px solid #b8892a; border-radius: 999px; background: linear-gradient(180deg, rgba(92, 64, 12, 0.94), rgba(58, 38, 8, 0.94));
  color: #ffe9b0; font-size: 14px; text-align: center; box-shadow: 0 4px 18px rgba(0, 0, 0, 0.45); }
#event[hidden] { display: none; }
#event b { color: var(--gold); margin-right: 2px; }
#event .sep { color: #b8892a; margin: 0 4px; }
#event:hover, #event:focus-visible, #event[aria-expanded="true"] { border-color: var(--gold); outline: none; }
#evbox { left: 50%; top: calc(var(--evb, 78px) + 6px); transform: translateX(-50%); width: min(520px, calc(100% - 32px)); max-height: calc(100% - 140px); overflow: auto; padding: 12px 14px; }
#evbox .phead h2 { margin-right: auto; }
#evbox section { padding: 6px 0 4px; border-top: 1px solid var(--line); }
#evbox h3 { margin: 0 0 4px; font: 700 16px var(--title); color: var(--gold); }
#evbox h3 small { display: block; font: 400 12.5px system-ui, sans-serif; color: var(--dim); }
#evbox ul { margin: 0; padding-left: 18px; font-size: 13.5px; }
#evbox li { margin: 3px 0; }
#evbox li b { color: #ffe9b0; }
#evbox li i { color: var(--dim); }
#evbox .note { margin: 8px 0 0; font-size: 12.5px; color: var(--dim); }
/* o número que o evento mudou (tarefa 50; o balão diz qual) */
.evm { margin-left: 2px; color: var(--gold); font-size: 0.85em; cursor: help; }
#hud:has(#event:not([hidden])) #toasts { top: calc(var(--evb, 78px) + 6px); }   /* logo abaixo da faixa (eventos.js mede onde ela termina) */
#hud:has(#event:not([hidden])) #banner { top: max(16%, calc(var(--evb, 78px) + 8px)); }   /* o nome da região também (deitado, 16% cai na faixa) */
/* com o painel aberto, os avisos vão para o lado (não cobrem o painel) */
#hud:has(#disc:not([hidden])) #toasts, #hud:has(#renew:not([hidden])) #toasts { left: auto; right: 12px; transform: none; justify-items: end; max-width: calc(50% - 300px); }
#bots .phead h2 { margin-right: auto; }
#bots .state { margin: 0 0 4px; font-size: 15px; }
#bots .state b.on { color: var(--good); }
#bots .state b.off { color: var(--dim); }
#bots .scroll { margin-top: 6px; }
#bots tr.idle td { color: var(--dim); }
#bots td.sit.play { color: var(--good); font-weight: 700; }
#bots td.sit.fell { color: var(--bad); }
#bots .sub { color: var(--dim); font-size: 12px; }
.phead { display: flex; align-items: center; gap: 12px; margin-bottom: 8px; }
.phead h2 { font: 700 24px var(--title); color: var(--gold); margin: 0; }
.tabs { display: flex; gap: 4px; margin-right: auto; }
.tabs button { padding: 4px 10px; font-size: 13px; }
.tabs button.on { border-color: var(--gold); color: var(--gold); }
.phead .x { padding: 2px 9px; }
.scroll { overflow: auto; min-height: 0; flex: 1; }
table.rank { width: 100%; border-collapse: collapse; font-size: 14px; }
table.rank th { text-align: left; color: var(--dim); font-weight: 500; font-size: 12px; padding: 4px 6px; border-bottom: 1px solid var(--line); position: sticky; top: 0; background: var(--panel2); }
table.rank td { padding: 5px 6px; border-bottom: 1px solid rgba(255, 255, 255, 0.05); vertical-align: middle; }
table.rank td.nm { font-weight: 700; white-space: nowrap; }
table.rank .dot { display: inline-block; width: 10px; height: 10px; border-radius: 50%; margin-right: 6px; border: 1px solid rgba(255, 255, 255, 0.6); }
table.rank tr.me td { background: rgba(227, 185, 95, 0.08); }
table.rank tr.ally .sit { color: #7fb8ff; }
table.rank tr.war .sit { color: var(--bad); font-weight: 700; }
table.rank td.ra { text-align: right; white-space: nowrap; }
table.rank td.ra button { padding: 3px 8px; font-size: 12.5px; margin-left: 4px; }
table.rank td.ra button.on { border-color: var(--gold); color: var(--gold); }
select { font: inherit; color: var(--ink); background: #0b100a; border: 1px solid var(--line); border-radius: 6px; padding: 4px 8px; }
ul.log { list-style: none; margin: 0; padding: 0; }
ul.log li { padding: 5px 2px; border-bottom: 1px solid rgba(255, 255, 255, 0.05); }
ul.log .t { color: var(--dim); font-size: 12px; margin-right: 10px; display: inline-block; min-width: 72px; }

/* carroça: o formulário da carta e do tributo; no painel, a carga e a carta */
#cart { left: 50%; top: 52px; transform: translateX(-50%); width: min(470px, calc(100% - 32px)); max-height: calc(100% - 270px); overflow: auto; padding: 12px 14px; display: grid; gap: 9px; }
#cart[hidden] { display: none; }
#cart .phead { margin: 0; }
#cart .phead h2 { margin-right: auto; }
#cart label.f { display: grid; gap: 4px; color: var(--dim); font-size: 13px; }
#cart textarea { font: inherit; color: var(--ink); background: #0b100a; border: 1px solid var(--line); border-radius: 6px; padding: 8px 10px; resize: vertical; min-height: 86px; }
#cart textarea:focus-visible, #cart select:focus-visible { outline: 2px solid var(--gold); outline-offset: 2px; }
#cart fieldset { border: 1px solid var(--line); border-radius: 8px; padding: 6px 10px 9px; margin: 0; min-width: 0; }
#cart fieldset:disabled .cres { opacity: 0.5; }
#cart legend { color: var(--dim); font-size: 13px; padding: 0 4px; }
#cart .cres { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; }
#cart .cres label { display: flex; align-items: center; gap: 4px; }
#cart .cres input { padding: 4px 6px; min-width: 0; }
#cart .cnt { margin-left: 6px; font-variant-numeric: tabular-nums; }
#cart .cnt.bad { color: var(--bad); font-weight: 700; }
#cart .note, #cart .warn { margin: 0; }
#cart .row { display: flex; gap: 8px; justify-content: flex-end; }

/* doações (tarefa 54): o quadro "Doar para X"; no painel dos reinos, os pedidos esperando o aceite; no resumo de quem
   volta, as que chegaram; o registro do administrador */
#doar { left: 50%; top: 52px; transform: translateX(-50%); width: min(520px, calc(100% - 32px)); max-height: calc(100% - 270px); overflow: auto; padding: 12px 14px; display: grid; gap: 9px; }
#doar[hidden] { display: none; }
#doar .phead { margin: 0; }
#doar .phead h2 { margin-right: auto; font-size: 22px; overflow-wrap: anywhere; }
#doar label.f { display: grid; gap: 4px; color: var(--dim); font-size: 13px; }
#doar select:focus-visible, #doar input:focus-visible { outline: 2px solid var(--gold); outline-offset: 2px; }
#doar .tabs { margin: 0; }
#doar fieldset { border: 0; padding: 0; margin: 0; min-width: 0; }
#doar fieldset:disabled .cres { opacity: 0.5; }
#doar .cres { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; }
#doar .cres label { display: flex; align-items: center; gap: 4px; }
#doar .cres input { padding: 4px 6px; min-width: 0; }
#doar .dkinds { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 6px 14px; }
#doar .dkinds label { display: grid; grid-template-columns: 22px minmax(0, 1fr) 62px auto; align-items: center; gap: 6px; font-size: 13.5px; }
#doar .dkinds label > span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
#doar .dkinds label.off { opacity: 0.45; }
#doar .dkinds input { padding: 3px 6px; min-width: 0; }
#doar .dkinds small { color: var(--dim); font-size: 12px; white-space: nowrap; }
#doar .cnt { margin: 0; font-size: 13px; color: var(--dim); font-variant-numeric: tabular-nums; }
#doar .cnt.bad { color: var(--bad); font-weight: 700; }
#doar .note, #doar .warn, #doar .sub { margin: 0; }
#doar .row { display: flex; gap: 8px; justify-content: flex-end; }
#doar .row.l { justify-content: flex-start; }
#doar .row.l button { padding: 4px 10px; font-size: 13px; }
#realms .gifts { display: grid; gap: 6px; margin: 0 0 8px; }
#realms .gift { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 10px; padding: 7px 10px; border: 1px solid var(--gold2); border-radius: 8px; background: rgba(227, 185, 95, 0.08); font-size: 13.5px; }
#realms .gift.mine { border-color: var(--line); background: rgba(255, 255, 255, 0.03); }
#realms .gift > span:first-child { flex: 1 1 300px; min-width: 0; }
#realms .gift .dot, #realms .gift img { vertical-align: -2px; margin-right: 5px; }
#realms .gift .t { color: var(--dim); font-size: 12px; white-space: nowrap; }
#realms .gift .warn { display: block; margin: 3px 0 0; }
#realms .gift .ra { display: flex; gap: 6px; margin-left: auto; }
#realms .gift .ra button { padding: 3px 10px; font-size: 13px; }
#away h3.don { font: 700 18px var(--title); color: var(--good); margin: 4px 0 6px; display: flex; align-items: center; gap: 6px; }
#away h3.don .ico { width: 20px; height: 20px; }
#away ul.log.don { margin-bottom: 10px; }
#doacoes { left: 50%; top: 52px; transform: translateX(-50%); width: min(860px, calc(100% - 32px)); max-height: calc(100% - 120px); display: flex; flex-direction: column; padding: 12px 14px; }
#doacoes[hidden] { display: none; }
/* a trava do portal do Mundo Mágico (tarefa 66, portal.js) */
#portal { left: 50%; top: 52px; transform: translateX(-50%); width: min(560px, calc(100% - 32px)); max-height: calc(100% - 120px); overflow: auto; padding: 12px 14px; }
#portal[hidden] { display: none; }
#portal .phead h2 { margin-right: auto; }
#portal .state { margin: 0 0 6px; color: var(--dim); font-size: 13.5px; }
#portal .now { margin: 6px 0 8px; font-size: 14px; }
#portal .now b { color: var(--gold); }
#portal .now small { color: var(--dim); }
#portal .ctl .lb { min-width: 96px; }
#portal .prev { margin: 8px 0 4px; font-size: 13.5px; color: var(--dim); }
#portal .prev b { color: var(--gold); }
#portal select:disabled { opacity: 0.45; }
#portal .err { color: var(--bad); }
#portal > .note { margin-top: 10px; color: var(--dim); font-size: 13px; }
#portal > .note b { color: var(--gold); }
/* a chave do sono de quem ninguém está vendo (tarefa 68, sono.js) */
#sono { left: 50%; top: 52px; transform: translateX(-50%); width: min(520px, calc(100% - 32px)); max-height: calc(100% - 120px); overflow: auto; padding: 12px 14px; }
#sono[hidden] { display: none; }
#sono .phead h2 { margin-right: auto; }
#sono .state { margin: 0 0 6px; color: var(--dim); font-size: 13.5px; }
#sono .now { margin: 6px 0 8px; font-size: 14px; }
#sono .now b.on { color: var(--good); }
#sono .now b.off { color: var(--bad); }
#sono .now small { color: var(--dim); }
#sono table.nums { border-collapse: collapse; margin: 0 0 10px; font-size: 13.5px; }
#sono table.nums th { text-align: left; font-weight: 400; color: var(--dim); padding: 2px 14px 2px 0; white-space: nowrap; }
#sono table.nums td b { color: var(--gold); }
#sono table.nums td small { color: var(--dim); }
#sono .err { color: var(--bad); }
#sono > .note { margin-top: 10px; color: var(--dim); font-size: 13px; }
#doacoes .phead h2 { margin-right: auto; }
#doacoes .state { margin: 0 0 6px; color: var(--dim); font-size: 13.5px; }
#doacoes .ctl { margin: 0 0 6px; }
#doacoes .ctl input { width: min(280px, 100%); padding: 5px 9px; }
#doacoes td.t { white-space: nowrap; color: var(--dim); font-size: 12.5px; }
#doacoes td.sit.on { color: var(--gold); }
#doacoes td.sit.bad { color: var(--bad); }
.load span { white-space: nowrap; font-variant-numeric: tabular-nums; }
.load span + span { margin-left: 7px; }
.load .ico { width: 15px; height: 15px; vertical-align: -3px; margin-right: 2px; }
blockquote.letter { margin: 4px 0 2px; padding: 5px 10px; border-left: 3px solid var(--gold2); background: rgba(255, 255, 255, 0.04); font-style: italic; font-size: 13px;
  white-space: pre-wrap; overflow-wrap: anywhere; max-height: 66px; overflow: auto; }

/* espião: a lista dos reinos para infiltrar; no painel dos reinos, os relatórios */
#spyf { left: 50%; top: 52px; transform: translateX(-50%); width: min(600px, calc(100% - 32px)); max-height: calc(100% - 270px); overflow: auto; padding: 12px 14px; display: grid; gap: 9px; }
#spyf[hidden] { display: none; }
#spyf .phead { margin: 0; }
#spyf .phead h2 { margin-right: auto; }
#spyf .note, #spyf .warn { margin: 0; }
.tabs.sub { margin: 0 0 8px; flex-wrap: wrap; }
.tabs.sub small { color: var(--dim); margin-left: 4px; font-size: 11.5px; }
.rep { border: 1px solid var(--line); border-radius: 8px; padding: 7px 10px; margin-bottom: 8px; }
.rep .rh { font-size: 12.5px; color: var(--dim); margin-bottom: 5px; }
.rep .rh b { color: var(--ink); }
dl.rd { display: grid; grid-template-columns: max-content minmax(0, 1fr); gap: 3px 14px; margin: 0; font-size: 13.5px; }
dl.rd dt { color: var(--dim); }
dl.rd dd { margin: 0; overflow-wrap: anywhere; }
dl.rd dd button { padding: 1px 7px; font-size: 12px; margin-left: 4px; }
dl.rd .t { color: var(--dim); font-size: 12px; margin-right: 4px; }

/* enquanto você esteve fora */
#away { left: 50%; top: 50%; transform: translate(-50%, -50%); width: min(520px, calc(100% - 32px)); padding: 16px 20px; }
#away h2 { font: 700 24px var(--title); color: var(--gold); margin: 0 0 8px; }
#away ul { max-height: 50vh; overflow: auto; margin-bottom: 12px; }
#away { max-height: calc(100% - 32px); overflow: auto; }
#away.both ul { max-height: 24vh; }
#away h3.atk { font: 700 18px var(--title); color: #ff9c8a; margin: 4px 0 8px; }
/* um resumo de ataque com você fora (a tela de quem volta e a aba Ataques) */
.raid { border: 1px solid var(--line); border-left: 3px solid #d6574a; border-radius: 8px; padding: 7px 10px; margin-bottom: 8px; }
.raid .rh { display: flex; align-items: center; gap: 6px; margin-bottom: 5px; flex-wrap: wrap; }
.raid .rh .t { color: var(--dim); font-size: 12.5px; margin-left: auto; }
.raid .dot { display: inline-block; width: 10px; height: 10px; border-radius: 50%; border: 1px solid rgba(255, 255, 255, 0.6); }
.raid .ra { display: flex; gap: 6px; justify-content: flex-end; margin-top: 6px; }
.raid .ra button { padding: 2px 10px; font-size: 12.5px; }
table.rank tr.hl td { background: rgba(214, 87, 74, 0.2); }

/* bate-papo */
#chat { position: absolute; z-index: 3; left: 10px; bottom: 206px; width: min(440px, calc(100% - 20px)); pointer-events: none !important; }
#chat-log { max-height: 180px; overflow: hidden; display: flex; flex-direction: column; justify-content: flex-end; }
#chat .msg { margin: 1px 0; padding: 1px 6px; font-size: 14px; text-shadow: 0 1px 2px #000, 0 0 3px #000; border-radius: 4px; }
#chat .msg.old { display: none; }
#chat .msg .ch { color: #7fb8ff; }
#chat.open #chat-log { overflow: auto; max-height: 240px; background: rgba(10, 14, 9, 0.78); border: 1px solid var(--line); border-radius: 8px 8px 0 0; padding: 4px 0; pointer-events: auto; }
#chat.open .msg.old { display: block; }
#chat-form { display: flex; gap: 6px; pointer-events: auto; background: rgba(10, 14, 9, 0.9); padding: 6px; border: 1px solid var(--line); border-top: 0; border-radius: 0 0 8px 8px; }
#chat-form input { padding: 5px 8px; }
#chat-ch { padding: 4px 8px; font-size: 13px; white-space: nowrap; }
#chat-ch.ally { color: #7fb8ff; border-color: #2f6fb8; }
#chat-open { pointer-events: auto; margin-top: 4px; padding: 3px 8px; font-size: 15px; opacity: 0.8; }
#chat.open #chat-open { display: none; }
.fallen { background: rgba(120, 30, 20, 0.35); border: 1px solid #d6574a; border-radius: 8px; padding: 8px 10px; color: #ffd9d2; margin: 8px 0 12px; }
/* o aviso do mundo novo com as contas de antes (tarefa 70), na tela de fundar */
.novo { background: rgba(150, 110, 30, 0.28); border: 1px solid var(--gold); border-radius: 8px; padding: 8px 10px; color: #ffe9b8; margin: 8px 0 12px; }

#panel { position: absolute; z-index: 2; left: 0; right: 0; bottom: 0; height: 196px; display: grid; grid-template-columns: 196px 1fr 390px; gap: 10px;
  padding: 10px; background: linear-gradient(rgba(12, 16, 11, 0.86), rgba(10, 14, 9, 0.96)); border-top: 1px solid var(--line); }
#mini { width: 176px; height: 176px; border: 1px solid var(--line); border-radius: 6px; image-rendering: pixelated; cursor: pointer; background: #1b3a52; }
#mini.zn { border-color: #9b7fe0; }   /* no Mundo Mágico (tarefa 71) */
#sel { overflow: auto; padding: 2px 4px; }
#sel h3 { margin: 0; font: 700 20px var(--title); color: var(--gold); }
#sel .sub { color: var(--dim); margin: 0 0 6px; }
#sel .sub.prot { display: flex; align-items: center; gap: 5px; color: #b9d6f0; }   /* escolta e vigia (tarefa 23) */
#sel .sub.prot .ico { width: 15px; height: 15px; }
#sel .grid { display: flex; flex-wrap: wrap; gap: 6px; }
.chip { display: inline-flex; gap: 6px; align-items: center; padding: 4px 8px; background: rgba(255, 255, 255, 0.05); border: 1px solid var(--line); border-radius: 6px; }
.selhead { display: flex; gap: 12px; align-items: flex-start; }
.selhead > div:last-child { flex: 1; min-width: 0; }   /* a coluna de texto encolhe com a tela em vez de sair dela */
.portrait { width: 64px; height: 64px; flex: none; border-radius: 8px; border: 1px solid var(--line); background: #22301d; }
.meter { background: rgba(255, 255, 255, 0.08); border-radius: 4px; overflow: hidden; }
.meter i { display: block; height: 100%; background: linear-gradient(90deg, var(--gold2), var(--gold)); }
.trade { display: grid; grid-template-columns: 90px 1fr 92px; gap: 8px; align-items: center; font-size: 13px; margin: 3px 0; }
.trade .meter { height: 8px; }
.trade .lv { color: var(--dim); text-align: right; }
.trade .lv.l1 { color: #cfe3a0; } .trade .lv.l2 { color: var(--gold); font-weight: 700; }
/* o que está acontecendo agora (com o contador) e os números da construção em grade */
.work { margin: 2px 0 6px; max-width: 560px; }
.work .wl { font-size: 14px; color: var(--dim); }
.work .wl > b { color: var(--ink); }
.work .clk { color: var(--gold); font-variant-numeric: tabular-nums; }
.work .bad { color: var(--bad); }
.work .meter { height: 6px; margin-top: 3px; }
.facts { display: grid; grid-template-columns: repeat(auto-fill, minmax(118px, 1fr)); gap: 4px 14px; margin: 4px 0 6px; max-width: 760px; }
.facts div { display: grid; line-height: 1.2; }
.facts small { font-size: 11px; letter-spacing: 0.06em; text-transform: uppercase; color: var(--dim); }
.facts b { font-size: 14px; font-variant-numeric: tabular-nums; }
/* as linhas menores (a mina funda, tarefa 62); com elas a linha de quadros fica alta, e cada quadro fica no topo (o valor
   junto do rótulo, sem esticar até o pé da linha) */
.facts .fsub { display: block; font-size: 12px; font-weight: 400; color: var(--dim); }
.facts:has(.fsub) { align-items: start; }
.facts .rp { white-space: nowrap; }
.need { display: flex; flex-wrap: wrap; gap: 4px 6px; align-items: center; font-size: 13px; color: var(--dim); }
.need .chip { padding: 1px 7px; font-size: 12.5px; }
.need .chip.ok { border-color: #5f8f3f; color: #cfe3a0; }
.warn { color: var(--bad); font-size: 13px; margin: 6px 0 0; }
/* fila da construção selecionada: em cima dos botões, embaixo à direita */
#queue { position: absolute; right: 10px; bottom: calc(100% + 8px); display: flex; flex-direction: column; align-items: flex-end; gap: 5px; max-width: calc(100% - 20px); }
#queue .qcap { font-size: 12.5px; color: var(--dim); background: rgba(10, 14, 9, 0.85); border: 1px solid var(--line); border-radius: 6px; padding: 1px 8px; }
#queue .qcap.bad { color: #ffd9d2; border-color: #d6574a; background: rgba(70, 14, 10, 0.92); font-weight: 700; }
#queue .qrow { display: flex; gap: 6px; flex-wrap: wrap-reverse; justify-content: flex-end; }
.qslot { position: relative; width: 52px; height: 52px; padding: 4px; overflow: hidden; background: rgba(18, 24, 17, 0.95); }
.qslot .ico { width: 100%; height: 100%; }
.qslot .qn { position: absolute; top: 1px; left: 4px; font-size: 10.5px; color: var(--dim); }
.qslot.cur { width: auto; min-width: 180px; display: flex; align-items: center; gap: 8px; padding: 4px 12px 7px 4px; border-color: var(--gold2); }
.qslot.cur .qi { width: 42px; height: 42px; flex: none; }
.qslot .qt { display: grid; text-align: left; line-height: 1.15; }
.qslot .qt b { font-size: 13px; }
.qslot .qc { font: 700 18px var(--font); font-variant-numeric: tabular-nums; color: var(--gold); }
.qslot.cur::before { content: ''; position: absolute; left: 0; bottom: 0; height: 4px; width: var(--p, 0%); background: var(--gold); }
.qslot.stop { border-color: #d6574a; }
.qslot.stop .qc { color: var(--bad); font-size: 14px; }
.qslot.stop::before { background: #d6574a; }
.qslot:hover::after { content: '✕'; position: absolute; inset: 0; display: grid; place-items: center; background: rgba(110, 18, 12, 0.6); color: #fff; font-size: 20px; }
#acts { display: grid; grid-template-columns: repeat(5, 1fr); grid-auto-rows: 72px; gap: 6px; align-content: start; }
.act { position: relative; display: grid; grid-template-rows: 1fr auto; padding: 4px; text-align: center; font-size: 12px; line-height: 1.1; }
.act .ico { width: 34px; height: 34px; margin: 0 auto; }
.act .k { position: absolute; top: 3px; left: 5px; font-size: 11px; color: var(--dim); }
.act.on { border-color: var(--gold); box-shadow: inset 0 0 0 1px var(--gold); }
/* Eliminar (tarefa 48): a última, separada das outras na última coluna e com a borda vermelha; armada (Confirmar), cheia
   de vermelho */
.act.kill { grid-column: -2 / -1; border-color: rgba(214, 87, 74, 0.55); color: #ffb3a8; }
.act.kill:hover:not(:disabled) { border-color: #d6574a; }
.act.kill.on { border-color: #d6574a; background: rgba(110, 18, 12, 0.55); box-shadow: inset 0 0 0 1px #d6574a; color: #fff; }
.act .tag { position: absolute; top: 3px; right: 4px; font-size: 10.5px; font-weight: 700; color: var(--gold); }
/* com o desconto do evento (tarefa 19): a marca embaixo da etiqueta; no balão, o preço cheio riscado */
.act .sale { position: absolute; top: 17px; right: 3px; min-width: 15px; height: 15px; line-height: 15px; border-radius: 50%; font-size: 10px; font-weight: 700;
  color: #2a1a04; background: var(--gold); box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.35); }
.cost s { color: var(--dim); margin-right: 3px; text-decoration-thickness: 1.5px; }
.tip .sale { color: var(--gold); font-size: 12.5px; margin-top: 2px; }
.act > span:last-child { overflow: hidden; text-overflow: ellipsis; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
/* categoria com abas menores (Paisagismo: árvores, plantas e enfeites): elas na primeira linha dos botões */
#acts.subbed { grid-template-rows: 24px; grid-auto-rows: 68px; row-gap: 5px; }
#acts .stabs { grid-column: 1 / -1; display: flex; gap: 4px; }
.stab { display: flex; align-items: center; gap: 5px; padding: 1px 11px 1px 6px; font-size: 12.5px; line-height: 1; color: var(--dim); background: rgba(255, 255, 255, 0.03); border-radius: 12px; }
.stab .ico { width: 16px; height: 16px; opacity: 0.7; filter: saturate(0.6); }
.stab:hover:not(.on) { color: var(--ink); }
.stab:hover .ico, .stab.on .ico { opacity: 1; filter: none; }
.stab.on { color: var(--gold); font-weight: 700; border-color: var(--gold2); background: #0f150e; box-shadow: inset 0 0 0 1px var(--gold2); }
/* mais de 10 botões (as 10 obras de uma aba menor, mais Girar ou Recolher e Parar): uma coluna a mais, do mesmo tamanho */
@media (min-width: 901px) {
  #panel:has(#acts.wide) { grid-template-columns: 196px 1fr 468px; }
  #acts.wide { grid-template-columns: repeat(6, 1fr); }
  /* com Eliminar depois das 12 (tarefa 48), mais uma */
  #panel:has(#acts.wider) { grid-template-columns: 196px 1fr 546px; }
  #acts.wider { grid-template-columns: repeat(7, 1fr); }
  /* com o Mover para (tarefa 61) também: o construtor na aba de 10 obras, com Doar a… e Eliminar, chega a 15 */
  #panel:has(#acts.widest) { grid-template-columns: 196px 1fr 624px; }
  #acts.widest { grid-template-columns: repeat(8, 1fr); }
}
/* categorias das construções (construtor selecionado): abas presas na borda de cima do painel, sobre os botões; a da
   vez fica aberta, emendada no painel */
#cats { position: absolute; right: 10px; bottom: 100%; display: flex; align-items: flex-end; gap: 3px; max-width: calc(100% - 20px); overflow-x: auto; scrollbar-width: none; }
#cats[hidden] { display: none; }
.cat { display: flex; align-items: center; gap: 6px; padding: 5px 12px 6px 9px; font-size: 13.5px; line-height: 1.1; color: var(--dim); white-space: nowrap;
  background: rgba(10, 14, 9, 0.84); border: 1px solid var(--line); border-radius: 8px 8px 0 0; }
.cat .ico { width: 20px; height: 20px; flex: none; opacity: 0.7; filter: saturate(0.6); }
.cat:hover:not(.on) { color: var(--ink); background: rgba(28, 37, 25, 0.94); }
.cat:hover .ico, .cat.on .ico { opacity: 1; filter: none; }
.cat.on { padding-top: 7px; color: var(--gold); font-weight: 700; background: #0f150e; border-color: var(--gold2); border-bottom-color: transparent; box-shadow: inset 0 2px 0 var(--gold); }
/* ordens do construtor selecionado (Shift): cards em cima dos botões (e das abas das categorias) */
#orders { position: absolute; right: 10px; bottom: calc(100% + 8px); display: flex; flex-direction: column; align-items: flex-end; gap: 5px; max-width: calc(100% - 20px); }
#cats:not([hidden]) ~ #orders { bottom: calc(100% + 42px); }
#orders .qcap { font-size: 12.5px; color: var(--dim); background: rgba(10, 14, 9, 0.85); border: 1px solid var(--line); border-radius: 6px; padding: 1px 8px; }
#orders .qrow { display: flex; gap: 6px; flex-wrap: wrap-reverse; justify-content: flex-end; }
/* botão "Pegar obras pendentes" (construtores selecionados com obra que ninguém pegou) */
.opend { display: flex; align-items: center; gap: 7px; padding: 4px 12px 4px 5px; font-weight: 700; color: var(--gold); background: rgba(18, 24, 17, 0.95); border-color: var(--gold2); }
.opend .oi { width: 28px; height: 28px; flex: none; }
.opend:hover:not(:disabled) { background: #2a2512; }
.ocard { position: relative; display: flex; align-items: center; gap: 7px; width: 164px; padding: 5px 8px 8px 5px; overflow: hidden; text-align: left; background: rgba(18, 24, 17, 0.95); }
.ocard .oi { width: 34px; height: 34px; flex: none; }
.ocard .ot { display: grid; min-width: 0; line-height: 1.2; }
.ocard .ot b { font-size: 12.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; padding-right: 10px; }
.ocard .om { font: 700 14px var(--font); font-variant-numeric: tabular-nums; color: var(--ink); white-space: nowrap; }
.ocard .on { position: absolute; top: 2px; right: 6px; font-size: 10.5px; color: var(--dim); }
.ocard.cur { border-color: var(--gold2); }
.ocard.cur .om, .ocard.cur .on { color: var(--gold); }
.ocard.cur .on { font-size: 9.5px; text-transform: uppercase; letter-spacing: 0.05em; }
.ocard::before { content: ''; position: absolute; left: 0; bottom: 0; height: 4px; width: var(--p, 0%); background: #8aa36b; }
.ocard.cur::before { background: var(--gold); }
.ocard:hover::after { content: '✕'; position: absolute; inset: 0; display: grid; place-items: center; background: rgba(110, 18, 12, 0.6); color: #fff; font-size: 20px; }
/* número de cada ordem da fila, no lugar dela no mapa */
.onum { position: absolute; left: 0; top: 0; min-width: 19px; padding: 1px 5px; border-radius: 10px; text-align: center; font: 700 12px var(--font); color: #1a1408;
  background: var(--gold); box-shadow: 0 1px 3px rgba(0, 0, 0, 0.6); pointer-events: none; }
.tip { position: fixed; z-index: 30; max-width: 280px; background: var(--panel); border: 1px solid var(--line); border-radius: 8px; padding: 8px 10px; font-size: 13px; pointer-events: none; }
.tip b { color: var(--gold); }
.cost { display: flex; gap: 8px; margin-top: 4px; }
.cost span { display: inline-flex; align-items: center; gap: 3px; }
.cost .no { color: var(--bad); }
#loading { position: absolute; inset: 0; display: grid; place-items: center; font: 700 22px var(--title); color: var(--gold); background: var(--bg); }
#loading[hidden] { display: none; }
#loading.out { opacity: 0; transition: opacity 0.4s ease; }

/* o tutorial jogável (tarefa 35, client/js/tutorial.js): o balão pequeno, a seta do painel e o brilho do que clicar */
#tut { position: absolute; z-index: 5; left: 50%; bottom: 214px; transform: translateX(-50%); width: max-content; max-width: min(420px, calc(100% - 32px));
  background: var(--panel); border: 1px solid var(--gold2); border-radius: 12px; padding: 7px 12px 10px; box-shadow: 0 8px 30px rgba(0, 0, 0, 0.55); font-size: 17px; }
#tut .top { display: flex; align-items: center; justify-content: space-between; gap: 18px; margin-bottom: 3px; }
#tut .steps { display: flex; gap: 5px; }
#tut .steps i { width: 8px; height: 8px; border-radius: 50%; background: var(--line); }
#tut .steps i.done { background: var(--gold2); }
#tut .steps i.now { background: var(--gold); box-shadow: 0 0 6px var(--gold); }
#tut .skip { background: none; border: 0; padding: 2px 0; font-size: 13px; color: var(--dim); text-decoration: underline; }
#tut .skip:hover { color: var(--ink); }
#tut p { margin: 2px 0; }
#tut .ok { color: var(--good); font-size: 15px; }
#tut .do { font-weight: 500; }
#tut .see { margin-top: 6px; padding: 4px 12px; }
#tut .row { display: flex; gap: 8px; justify-content: flex-end; margin-top: 8px; }
#tut.end { padding-top: 10px; }
/* os capítulos (tarefa 40): o nome do capítulo aberto e a lista (no fim do básico e no menu Aprender mais) */
#tut .chn { font-size: 13px; font-weight: 600; color: var(--gold); white-space: nowrap; }
#tut.list { max-width: min(560px, calc(100% - 32px)); }
#tut .chaps { display: grid; grid-template-columns: 1fr 1fr; gap: 5px; margin-top: 7px; }
#tut .chaps .ch { display: grid; grid-template-columns: 1fr auto; align-items: baseline; gap: 0 8px; text-align: left; padding: 5px 9px; }
#tut .chaps .ch b { font-size: 15px; }
#tut .chaps .ch em { font-style: normal; font-size: 12.5px; color: var(--dim); }
#tut .chaps .ch span { grid-column: 1 / -1; font-size: 12.5px; color: var(--dim); }
#tut .chaps .ch.done { border-color: var(--good); }
#tut .chaps .ch.done em { color: var(--good); font-size: 15px; }
#tut-arrow { position: fixed; z-index: 8; width: 0; height: 0; transform: translate(-50%, -100%); border-left: 12px solid transparent; border-right: 12px solid transparent;
  border-top: 18px solid var(--gold); filter: drop-shadow(0 2px 3px rgba(0, 0, 0, 0.6)); animation: tut-bob 0.75s ease-in-out infinite alternate; }
#hud #tut-arrow { pointer-events: none; }
#tut-arrow.up { transform: translate(-50%, 0); border-top: 0; border-bottom: 18px solid var(--gold); animation-name: tut-bob-up; }
@keyframes tut-bob { from { margin-top: -9px; } to { margin-top: 0; } }
@keyframes tut-bob-up { from { margin-top: 9px; } to { margin-top: 0; } }
.tut-glow { outline: 2px solid var(--gold) !important; outline-offset: 1px; animation: tut-glow 0.9s ease-in-out infinite alternate; }
@keyframes tut-glow { from { box-shadow: 0 0 0 0 rgba(255, 210, 90, 0.9); } to { box-shadow: 0 0 14px 4px rgba(255, 210, 90, 0.7); } }

/* ============================================================ telas pequenas e toque (tarefa 47)
   Tudo o que muda no tablet e no celular fica aqui, num lugar só e nesta ordem: até 900 px de largura (o tablet em pé
   e o celular deitado; o deitado mais largo entra pela altura, até 500 px), até 560, até 520 (o celular em pé), o
   celular em pé ou deitado (a gaveta e as folhas), só em pé, só deitado e, por último, o toque (pointer: coarse). O computador
   (mais largo que 900) não passa por nada daqui: as regras de cima são as dele.
   A altura do topo fica em --top: o que se põe logo embaixo dele (as janelas, a orelhinha, os avisos) conta a partir dela. */
#top .ph { display: none; }   /* os ícones dos botões do topo, que no computador mostram a palavra */
#p-grip { display: none; }    /* o ⌃ da gaveta (o painel de baixo no celular) */
#keys { display: none; }      /* as chaves do toque (chaves.js): só na tela de toque */
.so-toque { display: none; }  /* as linhas da ajuda para o toque (no lugar das so-mouse, na tela de toque) */
/* o mapa e o minimapa: arrastar, a pinça e o giro com dois dedos são do jogo (input.js), não do navegador */
#view canvas, #mini { touch-action: none; }
#chat-x { flex: none; padding: 2px 9px; font-size: 14px; }   /* o ✕ do bate-papo: mandar não fecha (tarefa 53); no toque, maior */
/* o mapinha grande (responsivo.js; só na tela pequena): no meio da tela, por cima de tudo, com o fundo escuro */
#mini-bg { position: absolute; z-index: 9; inset: 0; display: grid; place-content: center; justify-items: center; gap: 10px; background: rgba(0, 0, 0, 0.6); }
#mini-bg[hidden] { display: none; }
#mini-bg #mini { position: static; width: min(92vw, calc(100dvh - var(--top) - 80px)); height: auto; aspect-ratio: 1; border-radius: 12px; border: 2px solid var(--gold2); }
#mini-bg .mb-row { display: flex; align-items: center; gap: 10px; width: min(92vw, 420px); color: var(--ink); font-size: 14px; text-align: center; }
#mini-bg .mb-row span { flex: 1; }
#mini-bg .mb-row button { flex: none; min-width: 48px; min-height: 48px; padding: 0; font-size: 24px; line-height: 1; }
@media (max-width: 900px), (max-height: 500px) and (orientation: landscape) {
  #hud { --top: 40px; }
  /* tela estreita: o painel ocupa a largura, de cima até a metade (o painel de baixo fica com a outra) */
  #povo { top: calc(var(--top) + 10px); right: 10px; width: auto; max-height: calc(50vh - var(--top) - 20px); }
  #hud:has(#povo:not([hidden])) #chat { left: 10px; width: min(440px, calc(100% - 20px)); }
  .pv-hint { display: none; }
  /* a orelhinha menor; o bate-papo, que aqui fica em cima, vai para o lado dela */
  #pv-tab { top: calc(var(--top) + 10px); width: 24px; gap: 4px; padding: 6px 0 7px; }
  #pv-tab .ico { width: 15px; height: 15px; }
  #pv-tab .pt-t { font-size: 14px; }
  #pv-tab i { min-width: 18px; padding: 0 2px; font-size: 12px; line-height: 16px; }
  /* o texto com pelo menos 12 px: o número no canto do botão, o "agora" dos cards, a setinha do grupo do Povo e os
     rótulos dos números (VIDA, NÍVEL...) */
  .act .tag, .ocard .on, .pv-tw, .facts small, .qslot .qn { font-size: 12px; }
  /* o "agora" do card da vez: com 12 px, comeria o nome no card estreito. O card da vez tem a borda dourada; com a
     gaveta fechada só ele aparece e, aberta, a linha de cima diz "Agora + N na fila" */
  .ocard.cur .on { display: none; }
  #hud:not(.ug):has(#pv-tab:not([hidden])) #chat { left: 30px; width: min(440px, calc(100% - 40px)); }
  /* o topo: o Povo tem a orelhinha e a música está no menu ☰; Mapa e Reinos só com o ícone */
  #r-povo, #r-mus { display: none; }
  #r-map, #r-realms { display: inline-flex; align-items: center; justify-content: center; padding: 3px 8px; }
  #r-map .tx, #r-realms .tx, #r-online .tx { display: none; }
  #r-online { padding: 3px 8px; }
  #top .ph { display: block; width: 22px; height: 22px; }
  #r-menu { font-size: 18px; line-height: 1; }
  #top { background: rgba(10, 14, 9, 0.93); }   /* firme: o nome dos reinos no mapa não aparece por trás dos botões */
  /* o painel de baixo e as janelas */
  #panel { grid-template-columns: 120px 1fr; grid-template-rows: auto auto; height: auto; max-height: 50vh; }
  #mini { width: 110px; height: 110px; }
  #acts { grid-column: 1 / -1; grid-template-columns: repeat(auto-fill, minmax(70px, 1fr)); grid-auto-rows: minmax(64px, auto); }   /* o nome em 2 linhas cabe */
  .cat:not(.on) span { display: none; }   /* tela estreita: só o ícone nas outras abas */
  .cat { padding: 5px 8px 6px; }
  .ocard { width: 136px; }
  .ocard .oi { width: 28px; height: 28px; }
  .res { padding: 2px 6px 2px 4px; } .res b { min-width: 0; }
  .res small { display: none; }   /* tela estreita: o limite só na dica e no vermelho de cheio */
  #r-name { display: none; }
  #status .chip .long { display: none; }
  #sel { max-height: 150px; }
  #chat { bottom: auto; top: calc(var(--top) + 10px); }
  #chat.open #chat-log { max-height: min(240px, calc(100dvh - var(--top) - 80px)); }   /* com o teclado aberto, o campo fica à vista */
  #hud:has(#chat.open) #banner { display: none; }   /* o nome da região cairia em cima do bate-papo aberto (tarefa 53) */
  #realms, #city, #cart, #doar { max-height: calc(100% - 70px); }
  #city .cols, .civ { grid-template-columns: 1fr; }
  table.rank td.ra { white-space: normal; }
  /* o tutorial */
  #tut { bottom: auto; top: calc(var(--top) + 10px); }
  /* o subsolo embaixo do topo; o 💬 no canto de cima, num lugar guardado no começo da barra de lá */
  #ug { top: var(--top); }
  #ug-bar::before { content: ''; flex: none; width: 44px; height: 44px; }
  #hud.ug #chat { left: 10px; top: calc(var(--top) + 2px); }
}
@media (max-width: 560px) { dl.rd { grid-template-columns: minmax(0, 1fr); } dl.rd dt { margin-top: 4px; } }
@media (max-width: 520px) {
  #hud { --top: 68px; }
  /* os reinos: cada reino numa linha (#, nome, era, pontos e situação) e os botões dele na linha de baixo */
  #realms table.rank, #realms table.rank :is(thead, tbody) { display: block; }
  #realms table.rank tr { display: grid; grid-template-columns: 24px minmax(0, 1.3fr) 30px 48px minmax(0, 1fr); align-items: center;   /* o nome com a bolinha do online (tarefa 55) */
    border-bottom: 1px solid rgba(255, 255, 255, 0.05); }
  #realms table.rank :is(td, th) { border-bottom: 0; }
  #realms table.rank th { position: static; }
  #realms table.rank thead tr { position: sticky; top: 0; z-index: 1; background: var(--panel2); border-bottom-color: var(--line); }
  #realms table.rank th:last-child, #realms table.rank td.ra:empty { display: none; }
  /* o nome encurta com as reticências; a bolinha, o brasão e o selo de bot (tarefa 55) ficam inteiros */
  #realms table.rank td.nm { overflow: hidden; }
  #realms table.rank td.nm .nml { display: flex; align-items: center; min-width: 0; }
  #realms table.rank td.nm .nmt { flex: 0 1 auto; min-width: 0; overflow: hidden; text-overflow: ellipsis; }
  #realms table.rank td.nm .nml > :not(.nmt) { flex: none; }
  #realms table.rank td.ra { grid-column: 1 / -1; display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 6px; padding-top: 0; }
  #realms table.rank td.ra button { margin-left: 0; }
  /* a orelhinha do povo (o painel é uma folha, mais embaixo) */
  #pv-tab { top: calc(var(--top) + 8px); }
  /* duas linhas no topo: os recursos em cima, de ponta a ponta; embaixo, a era, a cidade e os selos à esquerda (rolam
     para o lado se não couberem) e os botões do reino à direita */
  #top { padding: 4px 6px; gap: 4px 6px; height: var(--top); flex-wrap: wrap; align-content: space-between; }
  #res { gap: 3px; min-width: 0; width: 100%; height: 22px; justify-content: space-between; }
  #status { flex: 1 1 0; min-width: 0; margin-right: 0; overflow-x: auto; scrollbar-width: none; }
  #toasts { top: calc(var(--top) + 6px); width: calc(100% - 20px); }
  #ug-title, #ug-foot #ug-legend { display: none; }
  #ug-stats { flex: 1 1 calc(100% - 52px); min-width: 0; }   /* os números do subsolo no resto da linha do 💬, quebrando dentro dela */
  #ug-sel { top: auto; bottom: 64px; right: 8px; left: 8px; width: auto; }
  /* a faixa: no meio do espaço à direita da coluna do Povo e do 💬 (ela vai até 92 px), sem passar por baixo dele */
  #event { top: calc(var(--top) + 6px); font-size: 12.5px; padding: 4px 12px; border-radius: 10px; left: 100px; right: 8px; width: fit-content;
    max-width: none; margin-inline: auto; transform: none; }
  #wm-help { display: none; }
  #banner b { font-size: 24px; }
  #chat { top: calc(var(--top) + 6px); }
  #cart .cres, #doar .cres { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  #doar .dkinds { grid-template-columns: minmax(0, 1fr); }
  .res { gap: 3px; padding: 2px 5px 2px 3px; font-size: 12.5px; }
  .res .ico { width: 14px; height: 14px; }
  #realm { gap: 4px; }
  #status .chip { padding: 2px 5px; font-size: 12px; }
  #st-prot b, #st-war b { display: none; }
  /* painel da seleção estreito: números em colunas menores, ofícios sem sobrar */
  .facts { grid-template-columns: repeat(auto-fill, minmax(84px, 1fr)); gap: 3px 10px; }
  .work .wl { font-size: 13px; }
  .trade { grid-template-columns: 62px 1fr 58px; gap: 5px; font-size: 12px; }
  .qslot { width: 44px; height: 44px; }
  .qslot.cur { min-width: 150px; }
  .qslot.cur .qi { width: 34px; height: 34px; }
  .qslot .qc { font-size: 16px; }
}
/* O celular, em pé ou deitado (a mesma condição de DRAWER em responsivo.js): o painel de baixo é uma gaveta e as janelas
   grandes são folhas. Aqui, o que vale para os dois jeitos; depois, o que é só em pé (a gaveta embaixo) e só deitado
   (a gaveta à direita). */
@media (max-width: 520px), (max-height: 500px) and (orientation: landscape) {
  #wmap { inset: calc(var(--top) + 4px) 6px 6px; }
  /* as janelas grandes viram folhas (responsivo.js: uma aberta por vez, e o voltar do celular fecha): logo embaixo do
     topo e até onde o conteúdo pedir (o resto rola), com o ✕ grande sempre à vista. Com uma folha aberta, os avisos vão
     para baixo (em cima, cobririam o ✕). */
  :is(#povo, #realms, #city, #bots, #disc, #evbox, #renew, #rit, #tun, #crestp, #conta, #contas, #cart, #doar, #doacoes, #portal, #sono, #spyf, #help, #credits, #menu, #away) {
    left: 0; right: 0; top: var(--top); bottom: auto; transform: none; width: auto; max-width: none; min-height: 0;
    max-height: calc(100% - var(--top)); border-width: 0 0 1px; border-radius: 0 0 14px 14px; }
  #menu { overflow: auto; }
  :is(#disc, #evbox, #renew, #rit, #tun, #crestp, #conta, #contas, #cart, #doar, #doacoes, #portal, #sono, #spyf) > .phead { position: sticky; top: 0; z-index: 1; background: var(--panel); }
  /* o balanceamento (tarefa 51): a folha vai até embaixo (a lista rola dentro); as contas em cima da lista, curtas, e
     cada linha em duas (o nome; o padrão, o valor e o ↺) */
  #tun { bottom: 0; padding: 8px 10px; }
  #tun .tabs.sub { flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; }
  #tun .tabs.sub button { flex: none; }
  #tun .tn-body { grid-template-columns: minmax(0, 1fr); grid-template-rows: auto minmax(0, 1fr); gap: 8px; }
  #tun .tn-eff { order: -1; max-height: 26vh; padding: 0 0 8px; border-left: 0; border-bottom: 1px solid var(--line); }
  #tun .tr { grid-template-columns: auto minmax(0, 1fr) auto; }
  #tun .tr :is(.nm, .vw) { grid-column: 1 / -1; }
  #tun .tr .vw:empty { display: none; }
  #tun .tr .rs { grid-column: 3; grid-row: 2; min-width: 44px; min-height: 44px; }
  #tun .tr input { width: 112px; min-height: 44px; }
  #tun :is(.tn-foot, .tn-conf .ctl) button { min-height: 44px; }
  .phead { flex-wrap: wrap; gap: 6px 10px; }
  .phead h2 { margin-right: auto; font-size: 22px; }
  .phead .tabs { order: 3; flex: 1 0 100%; margin-right: 0; overflow-x: auto; scrollbar-width: none; }
  .phead .tabs button { flex: none; }
  :is(.phead .x, .pv-x, #wm-close) { min-width: 44px; min-height: 44px; padding: 0 10px; font-size: 18px; }
  /* Como jogar e Créditos: o texto rola e o botão de fechar fica embaixo, sempre à vista */
  :is(#help, #credits):not([hidden]) { display: flex; flex-direction: column; overflow: hidden; }
  :is(#help ul, #cr-body) { flex: 1 1 auto; min-height: 0; overflow-y: auto; overscroll-behavior: contain; margin-bottom: 10px; }
  :is(#h-close, #cr-close) { flex: none; width: 100%; min-height: 44px; }
  /* Enquanto você esteve fora: os ataques e o registro rolam; o Continuar fica embaixo, sempre à vista */
  #away:not([hidden]) { display: flex; flex-direction: column; overflow: hidden; }
  #away :is(.raids, ul.log) { flex: 0 1 auto; min-height: 0; max-height: none; overflow-y: auto; overscroll-behavior: contain; }
  #away-ok { flex: none; min-height: 44px; margin-top: 8px; }
  #hud:has(:is(#povo, #realms, #city, #bots, #disc, #evbox, #renew, #rit, #tun, #crestp, #conta, #contas, #cart, #doar, #doacoes, #spyf, #help, #credits, #menu, #away):not([hidden])) #toasts {
    left: 50%; right: auto; transform: translateX(-50%); justify-items: center; max-width: none; top: auto; bottom: 12px; }
  /* a gaveta (responsivo.js), em pé embaixo e deitado à direita:
     - Fechada (o normal): o retrato, o nome e uma linha da seleção, e as ações. Da fila e das ordens do construtor, só o
       card da vez.
     - Aberta (o ⌃, arrastar a alça ou tocar no nome): tudo. Os detalhes rolam; as abas e os botões ficam sempre à vista.
     - Ninguém selecionado: a gaveta some; o botão Reino abre o resumo e as ações do reino. */
  #panel { display: flex; flex-direction: column; gap: 6px; max-height: none;
    touch-action: none; }   /* arrastar a alça é da gaveta; o que rola dentro (as ações, os detalhes) continua rolando */
  #panel::before { content: ''; position: absolute; border-radius: 2px; background: #5d6e55; }
  #p-grip { display: grid; place-items: center; position: absolute; z-index: 1; top: 6px; right: 6px; width: 44px; height: 44px; padding: 0; color: var(--gold); }
  #p-grip svg { width: 22px; height: 22px; }
  #p-grip .tx { display: none; }
  #sel { order: 1; flex: none; max-height: 44px; overflow: hidden; padding: 0 98px 0 0; touch-action: none; }
  .selhead { gap: 8px; }
  .portrait { width: 40px; height: 40px; }
  #sel h3 { font-size: 17px; }
  #panel:not(.open) #sel h3 { overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }   /* fechada, o nome numa linha */
  #sel .fw-b { position: absolute; z-index: 1; top: 6px; right: 56px; width: 44px; height: 44px; padding: 0; justify-content: center; }
  #sel .fw-b span { display: none; }
  #sel .fw-b .ico { width: 22px; height: 22px; }
  #acts .act { flex: none; height: 64px; }
  #panel:not(.open) #acts .act > span:last-child { display: block; white-space: nowrap; }   /* fechada, o nome numa linha só */
  #acts .stabs, #panel:not(.open) #cats { display: none; }
  #panel:not(.open) :is(#queue, #orders) :is(.qcap, .qrow > :not(.cur, .opend)) { display: none; }
  /* ninguém selecionado: a gaveta some e fica só o mapa, com o botão Reino no canto (abre o resumo e as ações do reino) */
  #panel.none:not(.open) { padding: 0; border: 0; background: none; }
  #panel.none:not(.open)::before, #panel.none:not(.open) :is(#sel, #acts) { display: none; }
  #panel.none:not(.open) #p-grip { top: auto; bottom: 14px; right: 8px; display: flex; align-items: center; gap: 4px; width: auto; padding: 0 14px 0 8px;
    border-color: var(--gold2); border-radius: 22px; background: var(--panel); box-shadow: 0 2px 10px rgba(0, 0, 0, 0.6); font-weight: 700; }
  #panel.none:not(.open) #p-grip .tx { display: inline; }
  #panel.open #sel { flex: 0 1 auto; min-height: 0; max-height: none; overflow-y: auto; overscroll-behavior: contain; touch-action: auto; }
  #panel.open #acts { flex: none; display: grid; grid-template-columns: repeat(auto-fill, minmax(64px, 1fr)); grid-auto-rows: minmax(64px, auto); overflow: visible; }
  #panel.open #acts .act { width: auto; max-width: none; height: auto; }
  #panel.open #acts .stabs { display: flex; grid-column: 1 / -1; overflow-x: auto; scrollbar-width: none; }
  #panel.open #cats { position: static; order: 3; flex: none; max-width: none; margin-bottom: -6px; }
  #panel.open :is(#queue, #orders) { position: static; order: 2; flex: none; align-items: flex-start; max-width: none; }
  #panel.open :is(#queue, #orders) .qrow { justify-content: flex-start; flex-wrap: wrap; }
  /* o minimapa: um botão redondo no canto do mapa, junto da gaveta (tocado, abre grande: responsivo.js) */
  #mini { position: absolute; width: 52px; height: 52px; border-radius: 50%; border: 2px solid var(--gold2); box-shadow: 0 2px 10px rgba(0, 0, 0, 0.6); }
}
/* o celular em pé: a gaveta embaixo, com a alça em cima; fechada, as ações numa fileira que rola para o lado; aberta,
   até 55% da altura. As folhas na largura toda; o Povo para antes da gaveta (escolhendo gente na lista, a seleção e as
   ações dela continuam à vista embaixo). Da fila e das ordens, o card da vez fica por cima do mapa (como no computador). */
@media (max-width: 520px) {
  #povo { max-height: calc(100% - var(--top) - 150px); }
  #panel { padding: 16px 8px 8px; border-radius: 14px 14px 0 0; }
  #panel::before { top: 6px; left: calc(50% - 20px); width: 40px; height: 4px; }
  #panel.open #p-grip svg { transform: rotate(180deg); }
  #acts { order: 4; flex: none; display: flex; gap: 6px; overflow-x: auto; scrollbar-width: none; }
  #acts .act { width: auto; min-width: 64px; max-width: 132px; }
  #panel:not(.open) #acts .act.kill { margin-left: 12px; }   /* Eliminar, na fileira: um espaço antes (tarefa 48) */
  #panel:not(.open) #orders { bottom: calc(100% + 8px); }
  #panel.none:not(.open) { height: 0; }
  #panel.open { max-height: 55%; }
  #mini { left: 8px; bottom: calc(100% + 10px); }
  /* o tutorial */
  #tut { top: calc(var(--top) + 6px); font-size: 16px; }
  #tut .chaps { grid-template-columns: 1fr; }
}
/* o celular deitado: a gaveta à direita, da altura toda embaixo do topo, com a alça na beira esquerda, e o mapa à
   esquerda dela. Fechada, o card da vez da fila e as ações em 3 colunas, que rolam para baixo; aberta (o ‹, arrastar a
   alça para a esquerda ou tocar no nome), mais larga, com tudo. As folhas ficam no meio, com até 720 px; o Povo, à
   esquerda (o mapa e a gaveta continuam à vista). Os avisos e o tutorial, no meio do mapa (não da tela). */
@media (max-height: 500px) and (orientation: landscape) {
  #hud { --side: 280px; }
  :is(#realms, #city, #bots, #disc, #evbox, #renew, #rit, #tun, #crestp, #conta, #contas, #cart, #doar, #doacoes, #spyf, #help, #credits, #menu, #away) { width: min(720px, 100%); margin-inline: auto; }
  #povo { right: auto; width: min(380px, 50%); border-width: 0 1px 1px 0; border-radius: 0 0 14px 0; }
  #menu { grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); align-content: start; }
  #menu .som { grid-column: 1 / -1; }
  #panel { left: auto; right: 0; top: var(--top); bottom: 0; width: var(--side); height: auto; padding: 8px 8px 8px 18px; border-radius: 14px 0 0 0; }
  #panel::before { top: calc(50% - 20px); left: 7px; width: 4px; height: 40px; }
  #p-grip svg { transform: rotate(-90deg); }
  #panel.open #p-grip svg { transform: rotate(90deg); }
  #panel:not(.open) :is(#queue, #orders) { position: static; order: 2; flex: none; align-items: flex-start; max-width: none; }
  :is(#acts, #acts.wide, #acts.wider) { order: 4; flex: 0 1 auto; min-height: 0; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); grid-auto-rows: minmax(64px, auto);
    gap: 6px; overflow-y: auto; scrollbar-width: none; }   /* .wide: a regra do computador (6 colunas) também pegaria o deitado largo */
  #acts .act { width: auto; height: auto; min-height: 64px; }
  #panel:not(.open) #acts .act > span:last-child { white-space: normal; }   /* a coluna é estreita: o nome em 2 linhas */
  #panel:not(.open) #acts { grid-template-rows: none; }   /* fechada, as abas menores somem: sem a linha delas (.subbed) */
  #panel.none:not(.open) { width: 0; }
  #panel.open { width: min(460px, 56%); }
  #mini { right: calc(100% + 10px); bottom: 10px; }
  #panel.none:not(.open) #mini { right: 8px; bottom: 72px; }
  #toasts, #tut { left: calc((100% - var(--side)) / 2); }
  #toasts, #event { top: calc(var(--top) + 6px); }
  /* a faixa: entre a coluna do Povo e do 💬 (até 92 px) e a gaveta, no meio */
  #event { left: 100px; right: calc(var(--side) + 8px); width: fit-content; max-width: none; margin-inline: auto; transform: none; }
  /* a entrada e o fundar: o título à esquerda e o formulário à direita (a altura é pouca); o que passar rola */
  :is(#gate, #found) .card { width: min(820px, 100%); display: grid; grid-template-columns: minmax(0, 0.8fr) minmax(0, 1.2fr);
    grid-template-rows: auto auto auto auto 1fr; column-gap: 28px; align-items: start; padding: 20px 24px 16px; }
  :is(#gate, #found) .card > :is(.kicker, .fallen, .novo, h1, .lead) { grid-column: 1; }
  :is(#gate, #found) .card > :is(form, #done) { grid-column: 2; grid-row: 1 / -1; }
  /* aberta, a gaveta inteira rola (deitado, a altura não dá para tudo): o ‹ fica no canto, sempre à vista; o mapinha
     some até ela fechar (por fora da gaveta, ele seria cortado) */
  #panel.open { overflow-y: auto; overscroll-behavior: contain; scrollbar-width: none; touch-action: pan-y; }
  #panel.open #sel { flex: none; max-height: none; overflow: visible; }
  #panel.open #p-grip { position: sticky; top: 0; order: 0; flex: none; align-self: flex-end; margin-bottom: -50px; }
  #panel.open #mini { display: none; }
  #hud:has(#panel.none:not(.open)) :is(#toasts, #tut) { left: 50%; }
  #hud:has(#panel.none:not(.open)) #event { right: 8px; }
  /* o balão do tutorial no meio do mapa, sem cobrir o 💬 da esquerda; com a gaveta aberta (mais larga), encostado nela
     sem passar por cima */
  #tut:not(.list) { max-width: clamp(240px, calc(100% - var(--side) - 216px), 420px); }
  #hud:has(#panel.none:not(.open)) #tut:not(.list) { max-width: clamp(240px, calc(100% - 216px), 420px); }
  #hud:has(#panel.open) #tut:not(.list) { left: auto; right: calc(min(460px, 56%) + 8px); transform: none; max-width: max(200px, calc(100% - min(460px, 56%) - 112px)); }
}
@media (pointer: coarse) {
  html, body { overscroll-behavior: none; }   /* nada de puxar para recarregar a página no meio do jogo */
  .so-toque { display: list-item; }
  .so-mouse { display: none; }
  /* as chaves do toque (chaves.js): uma coluna no canto do mapa, em cima do painel (no celular, em cima do mapinha);
     somem com a gaveta aberta, no subsolo e com uma janela grande aberta */
  #keys:not([hidden]) { position: absolute; z-index: 1; left: 8px; bottom: calc(100% + 10px); display: flex; flex-direction: column-reverse; gap: 6px; }
  #keys button { display: grid; justify-items: center; align-content: center; gap: 1px; width: 52px; min-height: 50px; padding: 4px 0 3px;
    background: var(--panel); border: 1px solid var(--line); border-radius: 12px; box-shadow: 0 2px 10px rgba(0, 0, 0, 0.6); color: var(--ink);
    font-size: 12px; line-height: 1.1; }
  #keys button[hidden] { display: none; }
  #keys .ico { width: 22px; height: 22px; }
  #keys button[aria-pressed="true"] { border-color: var(--gold); background: #4a3c1c; color: var(--gold); box-shadow: 0 0 0 2px rgba(227, 185, 95, 0.35), 0 2px 10px rgba(0, 0, 0, 0.6); }
  #panel.open #keys, #hud.ug #keys,
  #hud:has(:is(#povo, #realms, #city, #bots, #disc, #evbox, #renew, #rit, #tun, #crestp, #conta, #contas, #cart, #doar, #doacoes, #spyf, #help, #credits, #menu, #away, #wmap):not([hidden])) #keys { display: none; }
  #chat-x { display: block; flex: none; min-width: 44px; padding: 0; font-size: 18px; }
  .pv-fw { opacity: 0.8; }
  .act .k { display: none; }   /* o número da tecla: no toque não há teclado */
  /* o dedo: o que se toca com pelo menos 44 px. Os botões, os campos e as listas de escolher crescem; o texto dos campos
     com 16 px (com menos, o iPhone aproxima a página ao tocar neles) */
  button, select, input:not([type="checkbox"], [type="radio"], [type="range"]) { min-height: 44px; }
  button { min-width: 44px; }
  select, input:not([type="checkbox"], [type="radio"], [type="range"]), textarea { font-size: 16px; }
  #tut .skip { margin-block: -11px; }   /* o Pular tutorial: os 44 px de toque, sem alargar o balão */
  .stab { border-radius: 22px; }
  #acts.subbed { grid-template-rows: 44px; }   /* a linha das abas menores (no computador, 24 px) */
  /* as caixinhas e as barras: o toque é a linha inteira (o rótulo) e a barra com 44 px de altura */
  label:has(> input:is([type="checkbox"], [type="radio"])) { min-height: 44px; }
  #menu .som input[type="checkbox"] { width: 22px; height: 22px; }
  input[type="range"] { height: 44px; }
  /* o Povo: as linhas e os grupos com 44 px; a caixinha e a câmera da linha ficam do tamanho de antes no desenho, mas
     pegam o toque em 44 px */
  .pv-h, .pv-r { min-height: 44px; }
  .pv-r { grid-template-columns: 44px 20px minmax(0, 1fr) auto 44px; padding-block: 0; }
  .pv-ck { width: 44px; height: 44px; background: none; border-color: transparent; }
  .pv-ck:hover:not(:disabled) { border-color: transparent; }
  .pv-ck::before { content: ''; position: absolute; inset: 11px; border: 1px solid var(--line); border-radius: 4px; background: #0b100a; }
  .pv-ck[aria-checked="mixed"]::after { left: 15px; right: 15px; top: 21px; }
  /* os símbolos do brasão: a grade com 44 px por símbolo */
  .cp-sym { grid-template-columns: repeat(auto-fill, minmax(44px, 1fr)); }
  /* o Balanceamento (tarefa 51): o título de cada grupo com 44 px */
  #tun details.tg > summary { padding-block: 12px; }
}
@media (max-width: 900px) and (pointer: coarse), (max-height: 500px) and (orientation: landscape) and (pointer: coarse) {
  /* o dedo: os botões do topo (e os selos ao lado deles) com 44 px */
  #hud { --top: 50px; }
  #top { height: var(--top); padding-block: 3px; }
  #top button, #r-home { min-width: 44px; min-height: 44px; }
  #r-home { justify-content: center; padding: 0; background: var(--panel2); border: 1px solid var(--line); border-radius: 6px; }
  #status .chip { min-height: 44px; min-width: 44px; justify-content: center; font-size: 13px; }
  /* a coluna da esquerda: a orelhinha do Povo continua fina (não cobre o mapa), mas o toque pega 44 px de largura (a
     parte de fora, à direita dela, é transparente); o 💬 com 44 px, logo depois */
  #pv-tab { width: 44px; padding-right: 20px; background: none; border: 0; box-shadow: none; }
  #pv-tab::before { content: ''; position: absolute; z-index: -1; inset: 0 20px 0 0; background: var(--panel); border: 1px solid var(--line);
    border-left: 0; border-radius: 0 9px 9px 0; box-shadow: 0 6px 20px rgba(0, 0, 0, 0.45); }
  #pv-tab:hover { background: none; }
  #pv-tab:hover::before { border-color: var(--gold); background: var(--panel2); }
  #hud:not(.ug):has(#pv-tab:not([hidden])) #chat { left: 48px; width: min(440px, calc(100% - 56px)); }
  #chat-open { min-width: 44px; min-height: 44px; padding: 0; font-size: 18px; opacity: 0.9; }
  /* o bate-papo aberto: o campo, o canal e o ✕ com 44 px; o texto do campo com 16 px (com menos, o iPhone aproxima a
     página ao tocar nele) */
  #chat-form input { min-height: 44px; font-size: 16px; }
  #chat-ch { min-height: 44px; }
}
@media (max-width: 520px) and (pointer: coarse) {
  #hud { --top: 82px; }
  #top { padding-block: 4px; }
  #keys:not([hidden]) { bottom: calc(100% + 72px); }   /* em cima do mapinha */
  #wm-help { display: block; }   /* no toque, a ajuda do mapa do mundo fica: segurar o dedo não se descobre sozinho */
}
/* deitado: as chaves numa fileira do lado do mapinha (a altura é pouca) */
@media (max-height: 500px) and (orientation: landscape) and (pointer: coarse) {
  #keys:not([hidden]) { left: auto; right: calc(100% + 72px); bottom: 10px; flex-direction: row-reverse; }
  #panel.none:not(.open) #keys:not([hidden]) { right: 72px; bottom: 72px; }
}
