﻿:root {
  --fundo: #141012; --painel: #1f191c; --painel2: #2a2226; --linha: #3a3035;
  --ouro: #ffcb00; --texto: #f5efe6; --suave: #b8aca4; --ok: #2a9d8f; --mau: #e63946; --azul: #3a86ff;
  --raio: 14px;
}
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; height: 100%; overflow: hidden; background: var(--fundo); color: var(--texto);
  font-family: Figtree, Inter, system-ui, -apple-system, Segoe UI, Roboto, sans-serif; touch-action: none; user-select: none; }
canvas#jogo { position: fixed; inset: 0; display: block; image-rendering: pixelated; }
button { font-family: inherit; color: inherit; cursor: pointer; }
small { display: block; color: var(--suave); font-size: 12px; }

/* ---------- HUD ---------- */
#hud { display: none; }
#hud.on { display: block; }
.hud-topo { position: fixed; top: max(8px, env(safe-area-inset-top)); left: 8px; right: 8px; display: flex; gap: 8px; align-items: stretch; pointer-events: none; z-index: 5; }
.hud-dinheiro { background: rgba(20,16,18,.86); border: 1px solid var(--linha); border-radius: 12px; padding: 6px 12px; min-width: 128px; }
.hud-dinheiro b { color: var(--ouro); font-size: 18px; font-weight: 800; }
.hud-dinheiro small { font-size: 11px; }
.barras { background: rgba(20,16,18,.86); border: 1px solid var(--linha); border-radius: 12px; padding: 6px 10px; display: grid; grid-template-columns: 1fr 1fr; gap: 3px 10px; flex: 1; max-width: 300px; }
.b { display: flex; align-items: center; gap: 5px; font-size: 11px; }
.b span { flex: 1; height: 7px; background: #3a3035; border-radius: 4px; overflow: hidden; }
.b i { display: block; height: 100%; background: var(--ok); transition: width .3s; }
.b.baixo i { background: var(--mau); animation: pulsar 1s infinite; }
@keyframes pulsar { 50% { opacity: .5; } }
#hZona { position: fixed; top: calc(max(8px, env(safe-area-inset-top)) + 58px); left: 8px; background: rgba(20,16,18,.8); border-radius: 10px; padding: 4px 10px; font-size: 11px; color: var(--suave); z-index: 5; pointer-events: none; max-width: calc(100vw - 140px); }
#hZona b { color: var(--texto); }
#hZona i, i.dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; margin: 0 3px 0 6px; vertical-align: middle; }
#hProc { position: fixed; top: calc(max(8px, env(safe-area-inset-top)) + 136px); left: 8px; background: var(--mau); border-radius: 10px; padding: 3px 10px; font-size: 11px; font-weight: 800; z-index: 5; animation: pulsar 1s infinite; }
#obj { position: fixed; left: 50%; transform: translateX(-50%); bottom: calc(150px + env(safe-area-inset-bottom)); width: min(560px, calc(100vw - 24px)); background: rgba(20,16,18,.9); border: 1px solid var(--ouro); border-radius: 12px; padding: 8px 12px; font-size: 13px; line-height: 1.35; z-index: 5; cursor: pointer; }
#obj.pisca { animation: brilho 1.2s 2; }
@keyframes brilho { 50% { box-shadow: 0 0 0 4px rgba(255,203,0,.45); } }
#mini { position: fixed; top: calc(max(8px, env(safe-area-inset-top)) + 58px); right: 8px; width: 112px; height: 112px; border-radius: 50%; border: 3px solid var(--painel2); box-shadow: 0 2px 10px rgba(0,0,0,.5); z-index: 5; cursor: pointer; image-rendering: pixelated; }
#ticker { position: fixed; left: 0; right: 0; bottom: 0; height: calc(26px + env(safe-area-inset-bottom)); padding-bottom: env(safe-area-inset-bottom); background: #0c090a; border-top: 1px solid var(--linha); overflow: hidden; z-index: 4; font-size: 12px; white-space: nowrap; }
#ticker span { display: inline-block; padding-left: 100%; line-height: 26px; color: var(--ouro); animation: correr 26s linear infinite; }
@keyframes correr { to { transform: translateX(-100%); } }
#joyZona { position: fixed; left: 0; bottom: 26px; width: 55vw; height: 55vh; z-index: 3; touch-action: none; }
#joy { position: fixed; width: 110px; height: 110px; border-radius: 50%; background: rgba(255,255,255,.08); border: 2px solid rgba(255,255,255,.25); display: none; z-index: 3; pointer-events: none; }
#joy.on { display: block; }
#joyPega { position: absolute; left: 30px; top: 30px; width: 50px; height: 50px; border-radius: 50%; background: rgba(255,203,0,.7); }
#btnAcao { position: fixed; right: 14px; bottom: calc(84px + env(safe-area-inset-bottom)); display: none; align-items: center; gap: 8px; max-width: 64vw; background: var(--ouro); color: #141012; border: none; border-radius: 40px; padding: 10px 16px 10px 10px; font-weight: 800; font-size: 14px; box-shadow: 0 4px 14px rgba(0,0,0,.5); z-index: 6; }
#btnAcao.on { display: flex; animation: entrar .2s; }
#btnAcao b { background: #141012; color: var(--ouro); width: 30px; height: 30px; border-radius: 50%; display: grid; place-items: center; flex: none; }
#btnAcao span { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
#btnTel { position: fixed; right: 14px; bottom: calc(36px + env(safe-area-inset-bottom)); width: 46px; height: 46px; border-radius: 50%; background: var(--painel2); border: 2px solid var(--ouro); font-size: 22px; z-index: 6; }
@keyframes entrar { from { transform: scale(.8); opacity: 0; } }

/* ---------- toasts ---------- */
#toasts { position: fixed; top: calc(max(8px, env(safe-area-inset-top)) + 110px); left: 50%; transform: translateX(-50%); width: min(460px, calc(100vw - 24px)); display: flex; flex-direction: column; gap: 6px; z-index: 50; pointer-events: none; }
.toast { background: rgba(31,25,28,.96); border-left: 4px solid var(--azul); padding: 9px 12px; border-radius: 10px; font-size: 13px; box-shadow: 0 4px 14px rgba(0,0,0,.4); animation: entrar .2s; transition: opacity .5s, transform .5s; }
.toast.ok { border-color: var(--ok); } .toast.mau { border-color: var(--mau); }
.toast.sai { opacity: 0; transform: translateY(-8px); }

/* ---------- diálogo ---------- */
#dlg { position: fixed; left: 50%; bottom: calc(10px + env(safe-area-inset-bottom)); transform: translateX(-50%) translateY(calc(100% + 60px)); width: min(620px, calc(100vw - 16px)); max-height: 78vh; overflow: auto; background: var(--painel); border: 2px solid var(--ouro); border-radius: 18px; padding: 14px; z-index: 30; transition: transform .25s; }
#dlg.on { transform: translateX(-50%) translateY(0); }
.dlg-topo { display: flex; gap: 12px; align-items: center; }
.retrato { width: 64px; height: 64px; border-radius: 50%; border: 2px solid var(--ouro); flex: none; }
.dlg-nome b { font-size: 17px; color: var(--ouro); }
.dlg-txt { font-size: 15px; line-height: 1.5; min-height: 3em; margin: 10px 0 12px; }
.dlg-ops { display: flex; flex-direction: column; gap: 7px; }
.op { text-align: left; background: var(--painel2); border: 1px solid var(--linha); border-radius: 12px; padding: 11px 12px; font-size: 14px; display: flex; gap: 10px; align-items: flex-start; flex-wrap: wrap; }
.op:hover { border-color: var(--ouro); }
.op span { background: var(--ouro); color: #141012; font-weight: 800; border-radius: 6px; padding: 0 6px; font-size: 12px; }
.op small { width: 100%; color: var(--mau); padding-left: 30px; }
.op.desat { opacity: .45; cursor: not-allowed; }

/* ---------- painéis ---------- */
#painel, #tel { position: fixed; inset: 0; margin: auto; width: min(480px, calc(100vw - 16px)); height: min(86vh, 760px); background: var(--painel); border: 1px solid var(--linha); border-radius: 20px; z-index: 25; display: none; flex-direction: column; overflow: hidden; box-shadow: 0 10px 40px rgba(0,0,0,.6); }
#painel.on, #tel.on { display: flex; animation: entrar .18s; }
#painel { height: auto; max-height: 86vh; }
.pn-cab { display: flex; align-items: center; justify-content: space-between; padding: 12px 14px; border-bottom: 1px solid var(--linha); }
.pn-cab h2 { margin: 0; font-size: 18px; }
.fechar { background: var(--painel2); border: none; width: 34px; height: 34px; border-radius: 50%; font-size: 16px; }
.pn-corpo, .tel-corpo { padding: 12px 14px; overflow: auto; display: flex; flex-direction: column; gap: 8px; }
.btn { background: var(--painel2); border: 1px solid var(--linha); border-radius: 12px; padding: 11px 14px; font-size: 14px; text-align: left; }
.btn:hover { border-color: var(--ouro); }
.btn.prim { background: var(--ouro); color: #141012; font-weight: 800; text-align: center; border: none; }
.btn.acao small { margin-top: 2px; }
.nota { color: var(--suave); font-size: 12.5px; line-height: 1.45; margin: 2px 0; }
.linha { display: flex; gap: 6px; flex-wrap: wrap; }
.linha .btn { flex: 1; text-align: center; min-width: 110px; }
input { width: 100%; padding: 12px; border-radius: 12px; border: 1px solid var(--linha); background: #0f0c0d; color: var(--texto); font-size: 16px; font-family: inherit; user-select: text; }
.tab { width: 100%; border-collapse: collapse; font-size: 12px; }
.tab th, .tab td { padding: 6px 4px; border-bottom: 1px solid var(--linha); text-align: left; }
.tab th { color: var(--suave); font-weight: 600; }
.mau { color: var(--mau); font-weight: 600; }
.mini-barra { display: inline-block; width: 34px; height: 6px; background: #3a3035; border-radius: 3px; overflow: hidden; vertical-align: middle; }
.mini-barra span { display: block; height: 100%; }
.cartao { background: var(--painel2); border: 1px solid var(--linha); border-radius: 14px; padding: 11px 12px; display: flex; flex-direction: column; gap: 4px; }
.cartao b { font-size: 14px; } .cartao .grande { font-size: 22px; color: var(--ouro); }
.cartao.atual { border-color: var(--ouro); } .cartao.fechado { opacity: .6; }
.cartao .btn { margin-top: 6px; text-align: center; }
.tag { align-self: flex-start; background: var(--ouro); color: #141012; font-size: 10px; font-weight: 800; border-radius: 6px; padding: 1px 7px; text-transform: uppercase; }
.noticia { font-size: 13px; line-height: 1.45; border-left: 3px solid var(--ouro); padding-left: 10px; margin: 4px 0; }
.stats { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; }
.stats div { background: var(--painel2); border-radius: 10px; padding: 8px; } .stats b { font-size: 18px; }
h3 { margin: 10px 0 2px; font-size: 14px; color: var(--ouro); }

/* ---------- telemóvel ---------- */
#tel { border: 3px solid #000; outline: 2px solid var(--linha); }
.tel-topo { display: flex; justify-content: space-between; padding: 8px 16px; font-size: 12px; background: #0c090a; }
.tel-topo b { color: var(--ouro); }
.tel-apps { display: grid; grid-template-columns: repeat(6, 1fr); gap: 4px; padding: 8px; border-bottom: 1px solid var(--linha); }
.tel-apps button { background: var(--painel2); border: 1px solid transparent; border-radius: 12px; padding: 5px 0; font-size: 18px; }
.tel-apps button.on { border-color: var(--ouro); }
.tel-apps small { font-size: 10px; }
.tel-corpo { flex: 1; }
.tel-fechar { margin: 8px; background: var(--painel2); border: 1px solid var(--linha); border-radius: 12px; padding: 10px; }
.mapa-grande { width: 100%; border-radius: 12px; image-rendering: pixelated; }

/* ---------- turno (minijogo) ---------- */
#turno { position: fixed; inset: 0; margin: auto; width: min(460px, calc(100vw - 16px)); height: fit-content; max-height: 90vh; overflow: auto; background: var(--painel); border: 2px solid var(--ouro); border-radius: 20px; padding: 16px; z-index: 28; display: none; flex-direction: column; gap: 10px; }
#turno.on { display: flex; animation: entrar .18s; }
.tr-cab { font-weight: 800; display: flex; justify-content: space-between; color: var(--ouro); }
.tr-cab span { color: var(--suave); font-weight: 400; font-size: 12px; }
.tr-sit { font-size: 16px; line-height: 1.45; margin: 4px 0; }
.tr-tempo { height: 8px; background: #3a3035; border-radius: 4px; overflow: hidden; }
.tr-tempo i { display: block; height: 100%; width: 100%; background: var(--ouro); transition: width .1s linear; }
.tr-ops { display: flex; flex-direction: column; gap: 8px; min-height: 140px; }
.tr-fb { font-size: 18px; font-weight: 800; text-align: center; margin: 30px 0; }

/* ---------- cenas, fade, criação ---------- */
#cena { position: fixed; inset: 0; background: radial-gradient(circle at 50% 30%, #3a2a12, #0c090a 70%); z-index: 40; display: none; flex-direction: column; align-items: center; justify-content: center; padding: 24px; text-align: center; }
#cena.on { display: flex; animation: entrar .3s; }
#cena h2 { color: var(--ouro); font-size: 24px; margin: 0 0 12px; }
#cena p { max-width: 520px; font-size: 16px; line-height: 1.6; margin: 0 0 20px; }
#cena .btn { min-width: 200px; }
#fade { position: fixed; inset: 0; background: #000; opacity: 0; pointer-events: none; transition: opacity .35s; z-index: 45; }
#fade.on { opacity: 1; pointer-events: all; }
#criar { position: fixed; inset: 0; z-index: 60; background: radial-gradient(circle at 50% 0%, #4a3312, var(--fundo) 60%); display: none; overflow: auto; touch-action: pan-y; }
#criar.on { display: block; }
.cr-box { width: min(520px, 100%); margin: 0 auto; padding: 24px 16px 40px; display: flex; flex-direction: column; gap: 12px; }
.cr-box h1 { margin: 0; text-align: center; font-size: 40px; font-weight: 800; letter-spacing: 2px; }
.cr-box h1 span { color: var(--ouro); }
.sub { text-align: center; color: var(--suave); margin: 0; }
#crPrev { align-self: center; }
label { display: flex; flex-direction: column; gap: 4px; font-size: 13px; color: var(--suave); }
.cr-lin { display: flex; flex-direction: column; gap: 5px; }
.cores, .opcoes { display: flex; gap: 6px; flex-wrap: wrap; }
.cor { width: 34px; height: 34px; border-radius: 50%; border: 3px solid var(--painel2); }
.cor.on { border-color: var(--ouro); transform: scale(1.1); }
.opc { background: var(--painel2); border: 1px solid var(--linha); border-radius: 20px; padding: 7px 12px; font-size: 13px; }
.opc.on { border-color: var(--ouro); color: var(--ouro); }
.origens { display: flex; flex-direction: column; gap: 8px; }
.origem { text-align: left; background: var(--painel2); border: 2px solid var(--linha); border-radius: 14px; padding: 12px; display: grid; grid-template-columns: 1fr auto; gap: 2px 10px; }
.origem.on { border-color: var(--ouro); }
.origem small { grid-column: 1; }
.origem i { grid-row: 1 / 3; grid-column: 2; align-self: center; font-style: normal; color: var(--ouro); font-weight: 800; }

@media (min-width: 900px) {
  #joyZona { display: none; }
  #obj { bottom: 40px; }
  #btnAcao { bottom: 96px; }
}

/* ---------- v0.2: sistemas completos ---------- */
#hEstado, #hClima { position: fixed; left: 8px; background: rgba(20,16,18,.8); border-radius: 10px; padding: 3px 10px; font-size: 11px; z-index: 5; pointer-events: none; }
#hEstado { top: calc(max(8px, env(safe-area-inset-top)) + 84px); font-weight: 700; }
#hEstado.ok { color: #8be0d4; } #hEstado.medio { color: #f4a261; } #hEstado.mau { color: #ff8087; }
#hClima { top: calc(max(8px, env(safe-area-inset-top)) + 110px); color: var(--suave); }
#prov { position: fixed; inset: 0; z-index: 20; background: var(--fundo); display: none; flex-direction: column; overflow: auto; }
#prov.on { display: flex; }
.prov-cena { width: 100%; max-width: 640px; height: auto; align-self: center; border-radius: 0 0 18px 18px; image-rendering: auto; }
.prov-cab { padding: 10px 16px 0; max-width: 640px; width: 100%; align-self: center; }
.prov-cab h2 { margin: 0; color: var(--ouro); font-size: 26px; }
#prov .pn-corpo { max-width: 640px; width: 100%; align-self: center; padding-bottom: 40px; }
.cartao.clicavel { cursor: pointer; } .cartao.clicavel:hover { border-color: var(--ouro); }
.btn.fechado { opacity: .5; }
.btn.certo { background: var(--ok); color: #fff; }
.btn.grande { font-size: 18px; padding: 16px; }
.mini-barra.larga { width: 90px; height: 8px; }
.linha-barra { display: grid; grid-template-columns: 110px 1fr 34px; align-items: center; gap: 8px; margin: 2px 0; font-size: 13px; }
.linha-barra .mini-barra { width: 100%; }
.ritmo { position: relative; height: 26px; background: #3a3035; border-radius: 13px; overflow: hidden; margin: 10px 0; }
.ritmo .zona { position: absolute; top: 0; bottom: 0; background: rgba(42,157,143,.75); }
.ritmo .enche { position: absolute; left: 0; top: 0; bottom: 0; width: 0; background: var(--ouro); opacity: .85; }
.receita { font-size: 17px; line-height: 1.8; }
.chk { flex-direction: row; align-items: center; gap: 10px; color: var(--texto); }
.chk input { width: 20px; height: 20px; }
.linha .btn small { font-size: 11px; }
@media (max-width: 420px) { .tel-apps { grid-template-columns: repeat(6, 1fr); } .tel-apps small { font-size: 8.5px; } }
/* ---------- v0.3: interface simples e com reação ---------- */
.hud-topo { align-items: center; }
#hAvatar { pointer-events: auto; position: relative; width: 54px; height: 54px; flex: none; border-radius: 50%; border: 3px solid var(--ouro); background: radial-gradient(circle at 50% 35%, #4a3a2e, #1f191c); padding: 0; overflow: visible; box-shadow: 0 3px 10px rgba(0,0,0,.5); }
#hAvatarC { width: 100%; height: 100%; border-radius: 50%; display: block; }
#hLv { position: absolute; right: -6px; bottom: -6px; min-width: 24px; height: 24px; border-radius: 12px; background: var(--ouro); color: #141012; font-size: 13px; font-weight: 800; display: grid; place-items: center; border: 2px solid #141012; padding: 0 4px; }
.hud-dinheiro { min-width: 0; flex: 0 1 auto; padding: 5px 12px; }
.hud-dinheiro.pulsa b { animation: pulsaKz .45s; }
@keyframes pulsaKz { 40% { transform: scale(1.18); color: #7CFC9A; } }
.hud-dinheiro b { display: inline-block; transform-origin: left center; }
.xpbar { display: block; height: 5px; background: #3a3035; border-radius: 3px; overflow: hidden; margin: 3px 0 1px; min-width: 90px; }
.xpbar i { display: block; height: 100%; background: linear-gradient(90deg, #6f86d6, #9bb8ff); transition: width .4s; }
.barras { display: flex; gap: 6px; max-width: none; flex: none; padding: 5px 7px; background: rgba(20,16,18,.86); }
.b { --v: 100; --c: #2a9d8f; position: relative; width: 38px; height: 38px; border-radius: 50%; display: grid; place-items: center; font-size: 17px;
  background: conic-gradient(var(--c) calc(var(--v) * 1%), #3a3035 0); }
.b::before { content: ''; position: absolute; inset: 4px; border-radius: 50%; background: #1f191c; }
.b > * { position: relative; }
.b span { display: none; }
.b.baixo { --c: #e63946; animation: pulsar 1s infinite; }
.b:nth-child(1) { --c: #f4a261; } .b:nth-child(2) { --c: #ffcb00; } .b:nth-child(3) { --c: #06d6a0; } .b:nth-child(4) { --c: #ff4d6d; }
.b.baixo { --c: #e63946; }
#hInfo { position: fixed; top: calc(max(8px, env(safe-area-inset-top)) + 64px); left: 8px; right: 130px; display: flex; flex-wrap: wrap; gap: 4px; z-index: 5; pointer-events: none; }
#hInfo > span { position: static; background: rgba(20,16,18,.8); border-radius: 10px; padding: 3px 9px; font-size: 11px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 100%; }
#hInfo #hZona { color: var(--suave); }
#hEstado, #hClima { top: auto; left: auto; }
#hProc { top: calc(max(8px, env(safe-area-inset-top)) + 118px); }
#mini { top: calc(max(8px, env(safe-area-inset-top)) + 66px); width: 96px; height: 96px; }
#obj { padding-right: 82px; font-size: 13.5px; }
#objIr { position: fixed; z-index: 6; bottom: calc(158px + env(safe-area-inset-bottom)); left: calc(50% + min(280px, 50vw - 12px) - 78px); background: var(--ouro); color: #141012; border: none; font-weight: 800; font-size: 14px; padding: 8px 12px; border-radius: 10px; box-shadow: 0 3px 10px rgba(0,0,0,.4); animation: chama 1.6s infinite; }
@keyframes chama { 50% { transform: scale(1.07); } }
@media (min-width: 900px) { #objIr { bottom: 48px; } }

/* efeitos */
#fx { position: fixed; inset: 0; pointer-events: none; z-index: 70; overflow: hidden; }
.fx-txt { position: absolute; transform: translate(-50%, 0); font: 800 22px Figtree, system-ui, sans-serif; text-shadow: 0 2px 0 #000, 0 0 12px rgba(0,0,0,.6); white-space: nowrap; animation: sobeTxt 1.3s ease-out forwards; }
.fx-txt.grande { font-size: 34px; }
@keyframes sobeTxt { 0% { transform: translate(-50%, 10px) scale(.6); opacity: 0; } 15% { transform: translate(-50%, 0) scale(1.15); opacity: 1; } 100% { transform: translate(-50%, -70px) scale(1); opacity: 0; } }
.fx-moeda { position: absolute; font-size: 22px; margin: -11px 0 0 -11px; }
.fx-conf { position: absolute; top: 0; width: 8px; height: 13px; border-radius: 2px; }
.fx-banner { position: absolute; left: 50%; top: 30%; transform: translate(-50%, -50%); text-align: center; animation: banner 2.6s cubic-bezier(.2,.9,.3,1.3) forwards; }
.fx-banner b { display: block; font: 900 clamp(40px, 12vw, 72px) Figtree, system-ui; text-shadow: 0 4px 0 #000, 0 0 30px rgba(255,203,0,.6); letter-spacing: 1px; }
.fx-banner span { display: inline-block; margin-top: 6px; background: rgba(20,16,18,.9); border: 1px solid var(--ouro); border-radius: 20px; padding: 6px 14px; font-weight: 700; }
@keyframes banner { 0% { transform: translate(-50%, -50%) scale(.3); opacity: 0; } 15% { transform: translate(-50%, -50%) scale(1.1); opacity: 1; } 80% { opacity: 1; } 100% { transform: translate(-50%, -80%) scale(1); opacity: 0; } }
.tr-fb.top { color: var(--ouro); font-size: 30px; animation: entrar .25s; }

/* telemóvel: início com botões grandes */
#tel.inicio .tel-corpo { gap: 10px; }
.tel-casa { margin: 8px 8px 0; background: var(--painel2); border: 1px solid var(--linha); border-radius: 12px; padding: 8px; font-weight: 700; }
.tel-eu { display: flex; gap: 12px; align-items: center; background: linear-gradient(135deg, #3a2a14, #241b20); border-radius: 16px; padding: 10px 12px; }
.tel-eu .retrato { width: 60px; height: 60px; }
.tel-eu b { font-size: 18px; } .tel-eu > div { flex: 1; min-width: 0; }
.agora { display: flex; align-items: center; gap: 12px; text-align: left; background: var(--painel2); border: 2px solid var(--linha); border-radius: 16px; padding: 12px; }
.agora:hover, .agora:focus-visible { border-color: var(--ouro); }
.ag-ic { font-size: 30px; width: 44px; text-align: center; flex: none; }
.agora > span:nth-child(2) { flex: 1; min-width: 0; } .agora b { font-size: 16px; }
.ag-ir { background: var(--ouro); color: #141012; font-weight: 800; font-size: 13px; padding: 7px 10px; border-radius: 10px; flex: none; }
.tel-blocos { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; }
.bloco { --c: #ffcb00; aspect-ratio: 1; border: none; border-radius: 18px; background: linear-gradient(160deg, var(--c), color-mix(in srgb, var(--c) 55%, #000)); color: #fff; font-weight: 800; font-size: 12px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px; text-shadow: 0 1px 2px rgba(0,0,0,.5); box-shadow: 0 4px 0 color-mix(in srgb, var(--c) 40%, #000); transition: transform .1s; }
.bloco span { font-size: 28px; }
.bloco:active { transform: translateY(3px); box-shadow: 0 1px 0 color-mix(in srgb, var(--c) 40%, #000); }

/* histórias de vida */
.vida { background: linear-gradient(135deg, #2f2410, #241b20); border: 1px solid var(--ouro); border-radius: 14px; padding: 12px; display: flex; flex-direction: column; gap: 8px; }
.vida-cab { display: flex; justify-content: space-between; align-items: center; } .vida-cab span { color: var(--ouro); letter-spacing: 3px; }
.vida-fala { font-size: 15px; line-height: 1.45; margin: 0; font-style: italic; }
.btn.prim { animation: chama 1.6s infinite; }
@media (prefers-reduced-motion: reduce) { .btn.prim, #objIr, .b.baixo { animation: none; } }
/* v0.3 correções do HUD */
.b { z-index: 0; isolation: isolate; }
.b::before { z-index: -1; }
.hud-dinheiro { white-space: nowrap; }
.hud-dinheiro b { font-size: 16px; }
#hInfo { top: calc(max(8px, env(safe-area-inset-top)) + 72px); }
#hProc { top: calc(max(8px, env(safe-area-inset-top)) + 124px); }
@media (max-width: 420px) { .b { width: 34px; height: 34px; font-size: 15px; } .barras { gap: 4px; padding: 5px; } .hud-dinheiro { padding: 4px 9px; } .xpbar { min-width: 70px; } }

/* ---------- v0.4: painéis em folha de baixo (estilo app) ---------- */
#painel::before { content: ''; display: block; width: 44px; height: 5px; border-radius: 3px; background: var(--linha); margin: 8px auto 2px; }
@media (max-width: 700px) {
  #painel { inset: auto 0 0 0; margin: 0; width: 100%; max-height: 84vh; border-radius: 22px 22px 0 0; border-bottom: 0; animation: sobePainel .22s ease-out; }
  #tel { inset: auto 0 0 0; margin: 0; width: 100%; height: min(88vh, 760px); border-radius: 22px 22px 0 0; animation: sobePainel .22s ease-out; }
  #turno { inset: auto 0 0 0; margin: 0; width: 100%; border-radius: 22px 22px 0 0; animation: sobePainel .22s ease-out; }
}
@keyframes sobePainel { from { transform: translateY(40px); opacity: .6; } }
.btn.acao { min-height: 52px; font-size: 15px; border-radius: 14px; }
.btn:active { transform: scale(.98); }
#crSorte { text-align: center; border-color: var(--ouro); font-weight: 700; }
@media (prefers-reduced-motion: reduce) { #painel, #tel, #turno { animation: none; } }

/* ---------- 3D isométrico ---------- */
#jogo3d { position: fixed; inset: 0; width: 100%; height: 100%; display: block; z-index: 0; }
body.modo3d canvas#jogo { z-index: 1; background: transparent; pointer-events: auto; }
#zoom3d { display: none; position: fixed; right: 14px; top: calc(max(8px, env(safe-area-inset-top)) + 172px); z-index: 6; flex-direction: column; gap: 6px; }
body.modo3d #zoom3d { display: flex; }
#zoom3d button { width: 42px; height: 42px; border-radius: 12px; border: 1px solid var(--linha); background: rgba(20,16,18,.86); color: #fff; font-size: 22px; font-weight: 800; }
#velo { position: fixed; left: 50%; transform: translateX(-50%); bottom: calc(210px + env(safe-area-inset-bottom)); z-index: 6; background: rgba(20,16,18,.88); border: 2px solid var(--ouro); border-radius: 16px; padding: 6px 16px; text-align: center; pointer-events: none; }
#velo b { font-size: 30px; color: var(--ouro); font-variant-numeric: tabular-nums; line-height: 1; }
#velo small { display: inline; margin-left: 4px; }
#velo span { display: block; font-size: 11px; color: var(--suave); }
@media (min-width: 900px) { #velo { bottom: 140px; } }

/* ---------- voz, chamadas e sair do carro ---------- */
#vozBtn { position: fixed; right: 14px; bottom: calc(136px + env(safe-area-inset-bottom)); width: 46px; height: 46px; border-radius: 50%; border: 2px solid var(--linha); background: rgba(20,16,18,.9); font-size: 20px; z-index: 6; }
#vozBtn.on { border-color: #06d6a0; }
#vozBtn.falar { box-shadow: 0 0 0 4px rgba(6,214,160,.5); }
#btnSair { position: fixed; left: 50%; transform: translateX(-50%); bottom: calc(270px + env(safe-area-inset-bottom)); z-index: 7; background: var(--ouro); color: #141012; border: none; border-radius: 14px; padding: 10px 20px; font-weight: 800; font-size: 16px; box-shadow: 0 4px 0 #a8860b; }
@media (min-width: 900px) { #btnSair { bottom: 200px; } #vozBtn { bottom: 90px; } }
#chamada { position: fixed; top: calc(max(8px, env(safe-area-inset-top)) + 70px); left: 50%; transform: translateX(-50%); z-index: 60; width: min(320px, calc(100vw - 24px)); background: linear-gradient(160deg, #1d3557, #141012); border: 2px solid #06d6a0; border-radius: 22px; padding: 16px; text-align: center; box-shadow: 0 10px 30px rgba(0,0,0,.6); animation: entrar .25s; }
#chamada .ch-av { font-size: 34px; animation: chama 1.2s infinite; }
#chamada b { display: block; font-size: 20px; } #chamada small { font-size: 13px; }
.ch-bt { display: flex; gap: 8px; justify-content: center; margin-top: 12px; }
.ch-bt button { border: none; border-radius: 14px; padding: 10px 16px; font-weight: 800; font-size: 15px; }
.ch-sim { background: #06d6a0; color: #062; } .ch-nao { background: #e63946; color: #fff; }

/* ---------- MUNDO VIVO: cartão do acontecimento ---------- */
#evento { position: fixed; top: calc(max(8px, env(safe-area-inset-top)) + 98px); left: 50%; transform: translateX(-50%); z-index: 8; width: min(440px, calc(100vw - 150px)); display: flex; align-items: center; gap: 10px; background: linear-gradient(135deg, #6a040f, #1f191c); border: 2px solid #ff4d6d; border-radius: 16px; padding: 8px 10px; cursor: pointer; box-shadow: 0 6px 20px rgba(0,0,0,.5); animation: entrar .3s; }
#evento.perto { border-color: var(--ouro); background: linear-gradient(135deg, #7a5200, #1f191c); }
.ev-ic { font-size: 26px; animation: chama 1s infinite; } .ev-txt { flex: 1; min-width: 0; } .ev-txt b { display: block; font-size: 13px; line-height: 1.2; }
.ev-txt small { font-size: 12px; color: #ffd6dd; } .ev-ir { background: var(--ouro); color: #141012; font-weight: 800; font-size: 12px; border-radius: 10px; padding: 6px 9px; flex: none; }
@media (max-width: 420px) { #evento { top: calc(max(8px, env(safe-area-inset-top)) + 122px); width: calc(100vw - 24px); } }

/* ---------- contas e interior das casas ---------- */
#painel.on { z-index: 62; }
canvas.interior { width: 100%; height: auto; border-radius: 14px; border: 2px solid var(--linha); }
#crConta { text-align: center; }

/* ---------- viagem animada e stand 3D ---------- */
#viagem { position: fixed; inset: 0; z-index: 80; background: #0d3b66; display: flex; flex-direction: column; align-items: center; justify-content: center; cursor: pointer; animation: entrar .3s; }
#viagem canvas { max-width: 100%; max-height: 78vh; height: auto; width: auto; }
.vg-txt { text-align: center; color: #fff; padding: 10px 16px; width: min(460px, calc(100vw - 32px)); }
.vg-txt b { font-size: 20px; display: block; } .vg-txt small { color: #cfe3f5; }
.vg-barra { display: block; height: 8px; background: rgba(255,255,255,.2); border-radius: 4px; overflow: hidden; margin: 8px 0; } .vg-barra i { display: block; height: 100%; background: var(--ouro); }
canvas.stand3d { width: 100%; height: auto; border-radius: 16px; background: radial-gradient(circle at 50% 70%, #3a2f35, #141012); }
.stand-lista { display: grid; grid-template-columns: repeat(auto-fill, minmax(130px, 1fr)); gap: 6px; }
.stand-item { text-align: left; background: var(--painel2); border: 2px solid var(--linha); border-radius: 12px; padding: 8px; display: flex; flex-direction: column; gap: 2px; }
.stand-item.on { border-color: var(--ouro); } .stand-item i { width: 26px; height: 10px; border-radius: 3px; display: block; } .stand-item b { font-size: 12.5px; }

body.naprov #mini { display: none !important; }

/* ---------- dentro do carro ---------- */
#cabineUI { position: fixed; inset: 0; pointer-events: none; z-index: 7; }
#cabineUI > button, .pedais button { pointer-events: auto; position: absolute; border: none; border-radius: 16px; background: rgba(20,16,18,.78); color: #fff; font-size: 22px; font-weight: 800; display: flex; flex-direction: column; align-items: center; justify-content: center; box-shadow: 0 4px 0 rgba(0,0,0,.5); }
#cabineUI small { font-size: 10px; margin-top: 2px; color: #ddd; }
#cbVista { right: 14px; top: calc(max(8px, env(safe-area-inset-top)) + 230px); width: 58px; height: 58px; }
#cbBuzina { right: 14px; top: calc(max(8px, env(safe-area-inset-top)) + 296px); width: 58px; height: 58px; }
#cbRadio { right: 14px; top: calc(max(8px, env(safe-area-inset-top)) + 362px); width: 58px; height: 58px; }
.pedais { position: absolute; right: 14px; bottom: calc(40px + env(safe-area-inset-bottom)); width: 170px; height: 110px; }
#cbTravao { left: 0; bottom: 0; width: 72px; height: 84px; background: rgba(160,20,30,.85); }
#cbAcel { right: 0; bottom: 0; width: 80px; height: 108px; background: rgba(20,120,70,.88); }
.pedais button.on, #cabineUI > button:active { transform: translateY(3px); box-shadow: 0 1px 0 rgba(0,0,0,.5); }
body.cabine #velo, body.cabine #obj, body.cabine #objIr, body.cabine #btnAcao, body.cabine #btnTel, body.cabine #vozBtn, body.cabine #zoom3d, body.cabine #ticker { display: none !important; }
body.cabine #btnSair { bottom: auto; top: calc(max(8px, env(safe-area-inset-top)) + 170px); left: auto; right: 14px; transform: none; }

/* v0.15 — telemóvel: nada empilhado no topo nem por cima do objetivo */
@media (max-width: 899px) {
  #toasts { top: calc(max(8px, env(safe-area-inset-top)) + 172px); left: 12px; transform: none; width: calc(100vw - 80px); }
  #evento { top: auto; bottom: calc(216px + env(safe-area-inset-bottom)); width: calc(100vw - 24px); }
  #vozBtn { right: auto; left: 14px; bottom: calc(36px + env(safe-area-inset-bottom)); }
}

/* v0.16 — a conduzir na vista de cima: o joystick guia, nada tapa o velocímetro nem o zoom */
body.aconduzir .pedais { display: none; }
body.aconduzir #cbVista { top: calc(max(8px, env(safe-area-inset-top)) + 276px); }
body.aconduzir #cbBuzina { top: calc(max(8px, env(safe-area-inset-top)) + 342px); }
body.aconduzir #cbRadio { top: calc(max(8px, env(safe-area-inset-top)) + 408px); }
@media (max-width: 899px) {
  body.aconduzir #velo { left: 70px; transform: none; bottom: calc(36px + env(safe-area-inset-bottom)); padding: 3px 12px; }
  body.aconduzir #velo b { font-size: 24px; }
  body.aconduzir #btnSair { left: auto; right: 14px; transform: none; bottom: auto; top: calc(max(8px, env(safe-area-inset-top)) + 474px); }
}
@media (max-width: 899px) and (max-height: 740px) { body.aconduzir #obj, body.aconduzir #objIr { display: none !important; } }

/* v0.16 — táxi no mundo 3D */
#taxiCard { position: fixed; z-index: 8; left: 12px; top: calc(max(8px, env(safe-area-inset-top)) + 132px); width: min(420px, calc(100vw - 150px)); background: linear-gradient(135deg, #0b3d2e, #1f191c); border: 2px solid #7CFC9A; border-radius: 14px; padding: 6px 10px; font-size: 12.5px; pointer-events: none; box-shadow: 0 6px 18px rgba(0,0,0,.45); animation: entrar .25s; }
#taxiCard b { display: block; color: #7CFC9A; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
#taxiCard span { color: #eee; }
#taxiCard i { font-style: normal; font-weight: 800; }
#taxiCard i.pressa { color: #ff4d6d; }
body.comtaxi #toasts, body.perseguicao #toasts { top: calc(max(8px, env(safe-area-inset-top)) + 196px); }
body.aconduzir #objIr { display: none !important; }
@media (min-width: 900px) { #taxiCard { left: 50%; transform: translateX(-50%); top: calc(max(8px, env(safe-area-inset-top)) + 70px); } }

/* v0.17 — perseguição policial */
#persCard { position: fixed; z-index: 9; left: 12px; top: calc(max(8px, env(safe-area-inset-top)) + 132px); width: min(420px, calc(100vw - 150px)); background: linear-gradient(135deg, #6a040f, #14213d); border: 2px solid #ff4d6d; border-radius: 14px; padding: 6px 10px; font-size: 12.5px; pointer-events: none; box-shadow: 0 6px 18px rgba(0,0,0,.5); }
#persCard b { display: block; color: #fff; }
#persCard small { color: #ddd; }
#persCard .barra { display: block; height: 8px; margin: 4px 0; background: rgba(255,255,255,.15); border-radius: 6px; overflow: hidden; }
#persCard .barra i { display: block; height: 100%; background: linear-gradient(90deg, #ffcb00, #7CFC9A); transition: width .2s; }
#persCard.perigo { animation: pisca .4s infinite alternate; }
#persCard.perigo small { color: #ffcb00; font-weight: 800; }
@keyframes pisca { from { border-color: #ff4d6d; } to { border-color: #3a86ff; } }
body.perseguicao::after { content: ''; position: fixed; inset: 0; pointer-events: none; z-index: 4; box-shadow: inset 0 0 60px rgba(230,57,70,.5); animation: sirene .5s infinite alternate; }
@keyframes sirene { from { box-shadow: inset 0 0 60px rgba(230,57,70,.55); } to { box-shadow: inset 0 0 60px rgba(58,134,255,.55); } }
body.perseguicao #taxiCard { display: none; }
@media (min-width: 900px) { #persCard { left: 50%; transform: translateX(-50%); top: calc(max(8px, env(safe-area-inset-top)) + 70px); } }
@media (prefers-reduced-motion: reduce) { body.perseguicao::after, #persCard.perigo { animation: none; } }

/* v0.18 — viagens entre as 21 províncias */
.vg-txt em { display: block; margin-top: 8px; font-style: normal; font-size: 14px; color: #ffe9a8; min-height: 38px; }
.vg-saltar { position: absolute; right: 14px; top: calc(max(12px, env(safe-area-inset-top)) + 6px); background: rgba(20,16,18,.8); color: #fff; border: 1px solid var(--linha); border-radius: 12px; padding: 8px 12px; font-weight: 800; font-size: 13px; }
.vg-modo { display: flex; gap: 8px; margin-bottom: 8px; }
.vg-modo .btn { flex: 1; }
.btn.acao i { font-style: normal; opacity: .7; font-weight: 600; }

/* v0.18 — primeiro contacto: capa + 2 passos */
#criar.novo { background: radial-gradient(120% 70% at 50% 0%, #7a1020 0%, #2a1016 38%, var(--fundo) 72%); }
.en-capa, .en-passo { width: min(480px, 100%); margin: 0 auto; min-height: 100%; box-sizing: border-box; padding: calc(max(18px, env(safe-area-inset-top)) + 6px) 18px calc(28px + env(safe-area-inset-bottom)); display: flex; flex-direction: column; align-items: center; gap: 12px; text-align: center; }
.en-logo small { display: block; letter-spacing: 3px; font-size: 11px; font-weight: 800; color: #ffd98a; }
.en-logo h1 { margin: 2px 0 0; font-size: clamp(44px, 14vw, 64px); line-height: .95; font-weight: 800; letter-spacing: 1px; color: #fff; text-shadow: 0 4px 0 #000, 0 0 30px rgba(255,203,0,.35); }
.en-logo h1 span { display: block; color: var(--ouro); }
#enPalco { width: min(300px, 70vw); height: auto; margin: -6px 0 -10px; filter: drop-shadow(0 18px 24px rgba(0,0,0,.55)); animation: enFlutua 3s ease-in-out infinite; }
.en-passo #enPalco { width: min(210px, 52vw); margin: -8px 0; }
@keyframes enFlutua { 50% { transform: translateY(-6px); } }
.en-frase { margin: 0; font-size: 16px; line-height: 1.4; color: #f4e9dc; }
.en-frase b { color: var(--ouro); }
.en-online { background: rgba(6,214,160,.14); border: 1px solid rgba(6,214,160,.5); color: #b9ffe9; border-radius: 30px; padding: 7px 16px; font-size: 14px; font-weight: 600; }
.en-jogar { width: 100%; font-size: 21px !important; padding: 17px 16px !important; border-radius: 18px !important; letter-spacing: .5px; box-shadow: 0 6px 0 #a8860b, 0 14px 30px rgba(255,203,0,.25); }
.en-jogar:active { transform: translateY(4px); box-shadow: 0 2px 0 #a8860b; }
.en-conta, .en-passo .btn:not(.prim) { width: 100%; font-size: 16px; padding: 13px; border-radius: 16px; }
.en-chips { display: flex; flex-wrap: wrap; gap: 6px; justify-content: center; }
.en-chips span { background: rgba(255,255,255,.08); border: 1px solid var(--linha); border-radius: 20px; padding: 5px 10px; font-size: 12.5px; }
.en-prog { display: flex; gap: 6px; width: 100%; }
.en-prog i { flex: 1; height: 6px; border-radius: 4px; background: rgba(255,255,255,.15); }
.en-prog i.on { background: var(--ouro); }
.en-passo h2 { margin: 6px 0 0; font-size: 30px; font-weight: 800; }
.en-passo .sub { margin: 0; color: var(--suave); font-size: 14px; }
.en-passo #crNome { width: 100%; box-sizing: border-box; text-align: center; font-size: 20px; font-weight: 800; padding: 14px; border-radius: 16px; border: 2px solid var(--ouro); background: rgba(20,16,18,.7); color: #fff; outline: none; }
.en-leg { align-self: flex-start; font-size: 13px; }
.en-prontos { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; width: 100%; }
.en-pronto { background: var(--painel2); border: 2px solid var(--linha); border-radius: 16px; padding: 4px 0 0; display: flex; flex-direction: column; align-items: center; justify-content: center; font-size: 30px; min-height: 86px; }
.en-pronto canvas { width: 62px; height: auto; }
.en-pronto img { width: 100%; max-width: 92px; height: auto; display: block; margin: -4px 0 -2px; }
.en-pronto.on { border-color: var(--ouro); background: rgba(255,203,0,.12); transform: scale(1.04); }
.en-dado small { color: var(--suave); }
#enDet { width: 100%; display: flex; flex-direction: column; gap: 10px; text-align: left; background: rgba(0,0,0,.25); border-radius: 16px; padding: 12px; box-sizing: border-box; }
#enDet[hidden] { display: none; }
.en-origens { display: flex; flex-direction: column; gap: 10px; width: 100%; }
.en-origem { display: flex; align-items: center; gap: 12px; text-align: left; background: var(--painel2); border: 2px solid var(--linha); border-radius: 18px; padding: 14px 12px; }
.en-origem .ic { font-size: 38px; }
.en-origem .tx { flex: 1; }
.en-origem b { font-size: 18px; display: block; }
.en-origem em { font-style: normal; font-size: 11px; font-weight: 800; letter-spacing: 1px; margin-left: 4px; }
.en-origem small { font-size: 13px; }
.en-origem i { font-style: normal; color: var(--ouro); font-weight: 800; white-space: nowrap; }
.en-origem.on { border-color: var(--ouro); background: rgba(255,203,0,.1); }
.en-passo .chk { text-align: left; font-size: 15px; display: flex; gap: 10px; align-items: flex-start; width: 100%; }
.en-passo .chk input { width: 24px; height: 24px; flex: none; margin: 0; }
.en-passo .chk small { display: inline; }
@media (prefers-reduced-motion: reduce) { #enPalco { animation: none; } }

/* v0.18 — telemóvel: letras e botões maiores (iPhone e ecrãs pequenos) */
@media (max-width: 899px) {
  #hZona, #hEstado, #hClima { font-size: 12.5px; }
  .hud-dinheiro b { font-size: 20px; } .hud-dinheiro small { font-size: 12.5px; }
  #obj { font-size: 15px; padding-top: 10px; padding-bottom: 10px; }
  #objIr { font-size: 15.5px; padding: 10px 14px; }
  #btnAcao { font-size: 16px; padding: 12px 18px 12px 12px; }
  #btnTel { width: 54px; height: 54px; font-size: 26px; }
  #zoom3d button { width: 46px; height: 46px; }
  #toasts > * { font-size: 14.5px; }
  .btn.acao { font-size: 15.5px; } .btn.acao small { font-size: 13px; }
  small { font-size: 13px; }
}

/* v0.19 — HUD limpo no telemóvel: só o essencial no ecrã (o resto está no telemóvel do jogo) */
@media (max-width: 899px), (max-height: 520px) {
  #hClima, #hEstado.ok, #ticker, #hZona .det { display: none !important; }
  body.modo3d #zoom3d { display: none; }
  #mini { width: 84px; height: 84px; }
  #toasts { top: calc(max(8px, env(safe-area-inset-top)) + 96px); width: calc(100vw - 120px); }
  body.comtaxi #toasts, body.perseguicao #toasts { top: calc(max(8px, env(safe-area-inset-top)) + 196px); }
  #taxiCard, #persCard { top: calc(max(8px, env(safe-area-inset-top)) + 92px); width: calc(100vw - 124px); }
  #btnTel, #vozBtn { bottom: calc(14px + env(safe-area-inset-bottom)); }
  #obj { bottom: calc(132px + env(safe-area-inset-bottom)); }
  #objIr { bottom: calc(141px + env(safe-area-inset-bottom)); }
  #btnAcao { bottom: calc(74px + env(safe-area-inset-bottom)); }
  #evento { bottom: calc(200px + env(safe-area-inset-bottom)); }
  body.aconduzir #velo { bottom: calc(14px + env(safe-area-inset-bottom)); }
}
/* v0.19 — ecrã deitado (horizontal): vê-se mais mundo; o HUD vai para os cantos */
@media (orientation: landscape) and (max-height: 520px) {
  #joyZona { width: 45vw; height: 72vh; bottom: 0; }
  #obj { left: 50%; width: min(400px, 44vw); bottom: calc(8px + env(safe-area-inset-bottom)); font-size: 13px; padding: 6px 78px 6px 10px; }
  #objIr { bottom: calc(13px + env(safe-area-inset-bottom)); left: calc(50% + min(200px, 22vw) - 72px); padding: 6px 10px; font-size: 13.5px; }
  #btnAcao { right: calc(74px + env(safe-area-inset-right)); bottom: calc(14px + env(safe-area-inset-bottom)); max-width: 30vw; }
  #btnTel { right: calc(14px + env(safe-area-inset-right)); }
  #vozBtn { left: calc(14px + env(safe-area-inset-left)); }
  .hud-topo { left: calc(8px + env(safe-area-inset-left)); }
  #mini { right: calc(8px + env(safe-area-inset-right)); top: calc(max(8px, env(safe-area-inset-top)) + 4px); }
  #toasts { top: calc(max(8px, env(safe-area-inset-top)) + 62px); left: 50%; transform: translateX(-50%); width: min(420px, 46vw); }
  #evento { top: auto; bottom: calc(58px + env(safe-area-inset-bottom)); left: 50%; width: min(400px, 44vw); }
  #taxiCard, #persCard { left: 50%; transform: translateX(-50%); top: calc(max(8px, env(safe-area-inset-top)) + 62px); width: min(380px, 42vw); }
  body.comtaxi #toasts, body.perseguicao #toasts { top: calc(max(8px, env(safe-area-inset-top)) + 122px); }
  #btnSair { left: auto !important; right: calc(110px + env(safe-area-inset-right)) !important; top: calc(max(8px, env(safe-area-inset-top)) + 4px) !important; bottom: auto !important; transform: none !important; }
  body.aconduzir #cbVista, body.cabine #cbVista, #cbVista { top: calc(max(8px, env(safe-area-inset-top)) + 100px); }
  body.aconduzir #cbBuzina, #cbBuzina { top: calc(max(8px, env(safe-area-inset-top)) + 164px); }
  body.aconduzir #cbRadio, #cbRadio { top: calc(max(8px, env(safe-area-inset-top)) + 228px); }
  #cabineUI > button { width: 52px; height: 52px; right: calc(14px + env(safe-area-inset-right)); }
  .pedais { right: calc(84px + env(safe-area-inset-right)); bottom: calc(10px + env(safe-area-inset-bottom)); }
  body.aconduzir #velo { left: calc(14px + env(safe-area-inset-left)); bottom: calc(10px + env(safe-area-inset-bottom)); }
  .en-capa { flex-direction: row; flex-wrap: wrap; justify-content: center; align-content: center; column-gap: 24px; width: min(900px, 100%); }
  .en-capa #enPalco { width: min(200px, 26vw); order: -1; }
  .en-capa .en-jogar, .en-capa .en-conta { width: min(360px, 46vw); }
  .en-capa .en-chips, .en-capa .nota, .en-capa .en-frase { width: 100%; }
  .en-logo h1 { font-size: 40px; } .en-logo h1 span { display: inline; }
}

/* v0.19 — carta do destino */
.en-carta { width: 100%; box-sizing: border-box; min-height: 210px; border-radius: 22px; padding: 18px 16px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px; background: linear-gradient(160deg, #3a2a10, #1f191c); border: 3px dashed rgba(255,203,0,.5); }
.en-carta .ic { font-size: 64px; line-height: 1; }
.en-carta b { font-size: 24px; font-weight: 800; }
.en-carta em { font-style: normal; font-size: 12px; font-weight: 800; letter-spacing: 1.5px; }
.en-carta p { margin: 4px 0; font-size: 15px; line-height: 1.4; color: #f4e9dc; }
.en-carta small { font-size: 14px; color: #ffe9a8; font-weight: 600; }
.en-carta.a-rodar { border-style: solid; animation: enTreme .12s infinite; }
.en-carta.revelada { border: 3px solid var(--ouro); background: linear-gradient(160deg, #5a3d08, #1f191c); animation: enRevela .5s; box-shadow: 0 0 40px rgba(255,203,0,.3); }
@keyframes enTreme { 50% { transform: rotate(-1.2deg) scale(1.01); } }
@keyframes enRevela { 0% { transform: scale(.6) rotateY(90deg); } 60% { transform: scale(1.06); } 100% { transform: none; } }
[hidden] { display: none !important; }

/* v0.20 — viagem por dentro */
#viagem.dentro { background: #000; justify-content: flex-end; touch-action: none; }
#viagem.dentro canvas { position: absolute; inset: 0; max-width: none; max-height: none; width: 100%; height: 100%; }
#viagem.dentro .vg-txt { position: relative; z-index: 2; margin-bottom: calc(14px + env(safe-area-inset-bottom)); background: rgba(20,16,18,.82); border-radius: 16px; }
#viagem.dentro .vg-saltar { z-index: 3; top: auto; bottom: calc(118px + env(safe-area-inset-bottom)); }
.vg-dica { position: absolute; z-index: 2; left: 50%; top: 46%; transform: translateX(-50%); background: rgba(20,16,18,.7); color: #fff; padding: 8px 14px; border-radius: 20px; font-size: 14px; font-weight: 700; pointer-events: none; animation: vgDica 1.4s ease-in-out infinite; transition: opacity .4s; }
.vg-dica.sai { opacity: 0; }
@keyframes vgDica { 50% { transform: translateX(calc(-50% - 16px)); } }

/* v0.20 — escada de patentes e cargos */
.escada { display: flex; flex-direction: column; gap: 4px; margin: 6px 0 10px; }
.escada span { display: block; background: rgba(255,255,255,.05); border-radius: 10px; padding: 6px 10px; font-size: 14px; opacity: .65; }
.escada span small { display: block; font-size: 12.5px; }
.escada span.feito { opacity: .9; }
.escada span.agora { opacity: 1; background: rgba(255,203,0,.14); border: 1px solid var(--ouro); }
#persCard.caca { background: linear-gradient(135deg, #14213d, #1d3557); border-color: #3a86ff; }

/* v0.20 — primeiros passos (uma linha dentro do cartão do objetivo) */
#obj .passos { position: relative; margin: 7px -4px -2px; padding: 5px 8px; border-radius: 9px; background: rgba(124,252,154,.12); border: 1px solid rgba(124,252,154,.45); font-size: 13.5px; font-weight: 700; color: #c9ffd6; overflow: hidden; cursor: pointer; }
#obj .passos i { position: absolute; left: 0; top: 0; bottom: 0; background: rgba(124,252,154,.22); }
#obj .passos span { position: relative; }

/* v0.34 — 🔎 mapa com pesquisa */
.mp-busca { display: flex; flex-direction: column; gap: 8px; margin-bottom: 10px; }
.mp-busca input { width: 100%; box-sizing: border-box; padding: 11px 14px; border-radius: 12px; border: 2px solid rgba(255,255,255,.12); background: rgba(255,255,255,.07); color: inherit; font: 600 15px Figtree, system-ui; }
.mp-busca input:focus { outline: none; border-color: #ffcb00; }
.mp-chips { display: flex; gap: 6px; overflow-x: auto; padding-bottom: 4px; scrollbar-width: none; }
.mp-chips::-webkit-scrollbar { display: none; }
.mp-chip { flex: 0 0 auto; border: none; border-radius: 999px; padding: 7px 12px; background: rgba(255,255,255,.09); color: inherit; font: 700 13px Figtree, system-ui; white-space: nowrap; }
.mp-chip.on { background: #ffcb00; color: #141012; }
.mp-lista { display: flex; flex-direction: column; gap: 6px; }
.mp-res { display: flex; align-items: center; gap: 6px; padding: 8px 10px; border-radius: 12px; background: rgba(255,255,255,.06); }
.mp-res .mp-nome { flex: 1; min-width: 0; font-size: 14px; }
.mp-res .mp-nome small { display: block; opacity: .7; font-size: 12px; }
.mp-res .btn { flex: 0 0 auto; padding: 7px 10px; font-size: 13px; }

/* v0.33 — só se conduz por dentro: sem botão de mudar a vista */
#cbVista { display: none !important; }
/* v0.31 — 🧭 piloto automático: ao lado do botão Vista */
#cbAuto { right: 80px; top: calc(max(8px, env(safe-area-inset-top)) + 230px); width: 58px; height: 58px; }
body.aconduzir #cbAuto { top: calc(max(8px, env(safe-area-inset-top)) + 276px); }
#cbAuto.on { background: rgba(255,203,0,.95) !important; color: #141012; }
#cbAuto.on small { color: #141012; }
@media (orientation: landscape) and (max-height: 520px) { #cbAuto, body.aconduzir #cbAuto { top: calc(max(8px, env(safe-area-inset-top)) + 100px); right: calc(74px + env(safe-area-inset-right)); width: 52px; height: 52px; } }

/* v0.21 — turbo */
#cbTurbo { right: 14px; top: calc(max(8px, env(safe-area-inset-top)) + 428px); width: 58px; height: 58px; --t: 0%; background: linear-gradient(to top, rgba(255,120,0,.85) var(--t), rgba(20,16,18,.78) var(--t)) !important; opacity: .7; }
#cbTurbo.pronto { opacity: 1; box-shadow: 0 0 18px rgba(255,159,28,.8), 0 4px 0 rgba(0,0,0,.5) !important; animation: chama 1.2s infinite; }
body.aconduzir #cbTurbo { top: calc(max(8px, env(safe-area-inset-top)) + 474px); }
body.aconduzir #btnSair { top: calc(max(8px, env(safe-area-inset-top)) + 540px) !important; }
body.turbo #jogo { filter: saturate(1.25); }
body.turbo::before { content: ''; position: fixed; inset: 0; z-index: 4; pointer-events: none; background: radial-gradient(ellipse at center, transparent 55%, rgba(255,140,0,.28) 100%); animation: turboPulso .25s infinite alternate; }
@keyframes turboPulso { to { opacity: .55; } }
@media (orientation: landscape) and (max-height: 520px) { body.aconduzir #btnSair, body.cabine #btnSair { top: calc(max(8px, env(safe-area-inset-top)) + 4px) !important; } #cbTurbo { top: calc(max(8px, env(safe-area-inset-top)) + 292px); width: 52px; height: 52px; right: calc(14px + env(safe-area-inset-right)); } }

/* v0.22 — entrega de garrafa */
#flexShow { position: fixed; inset: 0; z-index: 90; background: #000; cursor: pointer; }
#flexShow canvas { position: absolute; inset: 0; }

/* v0.22 — dica de rodar o telemóvel */
#dicaRodar { position: fixed; z-index: 85; left: 14px; right: 14px; bottom: calc(110px + env(safe-area-inset-bottom)); background: linear-gradient(160deg, #2a1d05, #1f191c); border: 2px solid var(--ouro); border-radius: 20px; padding: 16px; display: flex; flex-direction: column; gap: 8px; text-align: center; box-shadow: 0 10px 40px rgba(0,0,0,.6); animation: entrar .3s; }
#dicaRodar b { font-size: 18px; } #dicaRodar small { font-size: 14px; }
#dicaRodar .dr-ic { font-size: 44px; animation: drRoda 1.6s ease-in-out infinite; }
@keyframes drRoda { 0%, 30% { transform: rotate(0); } 60%, 100% { transform: rotate(-90deg); } }

/* v0.23 — dentro dos edifícios */
body.dentro #mini, body.dentro #evento { display: none !important; }

/* v0.23 — botão de vista (de cima / de costas) */
#vistaBtn { position: fixed; z-index: 6; left: 70px; bottom: calc(14px + env(safe-area-inset-bottom)); width: 46px; height: 46px; border-radius: 50%; background: var(--painel2); border: 2px solid var(--linha); font-size: 20px; display: none; }
body.modo3d #vistaBtn { display: block; }
body.aconduzir #vistaBtn, body.cabine #vistaBtn { display: none !important; }
@media (min-width: 900px) { #vistaBtn { bottom: 36px; left: 74px; } }

/* v0.23 — Zap, Kandandu e gravação */
.zap { display: flex; flex-direction: column; gap: 6px; max-height: 46vh; overflow: auto; padding: 4px 0 10px; }
.zap-m { max-width: 78%; padding: 8px 12px; border-radius: 16px; font-size: 15px; line-height: 1.35; word-wrap: break-word; }
.zap-m.eu { align-self: flex-end; background: #0b6b3a; border-bottom-right-radius: 4px; }
.zap-m.ele { align-self: flex-start; background: var(--painel2); border-bottom-left-radius: 4px; }
.kd-post { background: rgba(255,255,255,.04); border: 1px solid var(--linha); border-radius: 16px; padding: 10px; margin: 10px 0; }
.kd-topo { display: flex; justify-content: space-between; align-items: baseline; margin-bottom: 6px; }
.kd-foto { width: 100%; border-radius: 12px; display: block; margin: 6px 0; }
.kd-acoes { display: flex; gap: 8px; } .kd-acoes .btn { flex: 0 0 auto; padding: 6px 12px; }
#painel textarea { width: 100%; box-sizing: border-box; border-radius: 12px; border: 1px solid var(--linha); background: rgba(0,0,0,.3); color: #fff; padding: 10px; font: 600 15px Figtree, system-ui; }
.rec { position: fixed; z-index: 95; top: calc(max(8px, env(safe-area-inset-top)) + 8px); left: 50%; transform: translateX(-50%); background: #c1121f; color: #fff; font-weight: 800; padding: 6px 14px; border-radius: 20px; animation: chama 1s infinite; pointer-events: none; }
/* v0.25: como queres viver? · ecrã limpo · #ID · eventos ao vivo · trabalhos */
.en-corpo { display: block; margin-top: 6px; font-weight: 800; color: var(--ouro); }
.en-vocacoes { width: 100%; display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.en-voc { background: rgba(20,16,18,.78); border: 2px solid var(--painel2); border-radius: 14px; color: #fff; padding: 9px 8px; text-align: left; display: flex; flex-direction: column; gap: 2px; font: inherit; cursor: pointer; }
.en-voc .ic { font-size: 24px; } .en-voc b { font-size: 15px; } .en-voc small { color: var(--suave); font-size: 11.5px; line-height: 1.25; }
.en-voc.on { border-color: var(--ouro); background: rgba(80,62,10,.85); transform: scale(1.02); }
body.ecraLimpo #obj, body.ecraLimpo #objIr, body.ecraLimpo #mini, body.ecraLimpo #ticker { display: none !important; }
.uid { font-size: 11px; font-weight: 800; color: var(--ouro); opacity: .85; margin-left: 6px; }
#evCard { position: fixed; left: 50%; transform: translateX(-50%); top: calc(max(8px, env(safe-area-inset-top)) + 64px); z-index: 9; width: min(360px, calc(100vw - 150px)); background: rgba(20,16,18,.94); border: 2px solid #ff4d6d; border-radius: 14px; padding: 8px 10px; font-size: 13px; text-align: center; box-shadow: 0 6px 20px rgba(0,0,0,.5); }
#evCard b { color: #ffcb00; } #evCard .btn { margin-top: 6px; padding: 7px 10px; font-size: 14px; }
#evCard .x { position: absolute; right: 4px; top: 0; background: none; border: 0; color: #aaa; font-size: 18px; }
#kuduro { position: fixed; inset: 0; z-index: 40; background: radial-gradient(circle at 50% 30%, #3a0d4a, #0b0710 70%); color: #fff; display: flex; flex-direction: column; align-items: center; touch-action: none; user-select: none; }
#kuduro canvas { width: min(420px, 100vw); flex: 1; }
#kuduro .kd-topo { padding: calc(max(10px, env(safe-area-inset-top)) + 4px) 12px 4px; font-weight: 800; display: flex; gap: 14px; font-size: 16px; }
#kuduro .kd-bts { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; width: min(420px, 100vw); padding: 8px 10px calc(14px + env(safe-area-inset-bottom)); box-sizing: border-box; }
#kuduro .kd-bts button { height: 74px; border-radius: 16px; border: 0; font-size: 30px; color: #141012; font-weight: 800; }
#kuduro .kd-bts button.on { filter: brightness(1.6); transform: scale(.94); }
.trab-ordem { display: flex; gap: 6px; flex-wrap: wrap; justify-content: center; font-size: 30px; margin: 8px 0; }
.trab-ordem span { background: rgba(255,255,255,.08); border-radius: 12px; padding: 6px 8px; }
.trab-ordem span.ok { background: rgba(6,214,160,.3); }
.trab-bts { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.trab-bts button { font-size: 30px; padding: 10px 0; border-radius: 14px; border: 2px solid var(--painel2); background: rgba(20,16,18,.8); }
.en-passo #enVai { position: sticky; bottom: calc(10px + env(safe-area-inset-bottom)); z-index: 2; }
@media (max-width: 420px) { .en-voc small { font-size: 11px; } .en-voc { padding: 7px; } }
#evCard { top: auto; bottom: calc(232px + env(safe-area-inset-bottom)); width: min(340px, calc(100vw - 24px)); }
@media (max-height: 560px) { #evCard { bottom: auto; top: 112px; left: auto; right: calc(8px + env(safe-area-inset-right)); transform: none; width: min(270px, 34vw); font-size: 12px; } }
/* v0.28: pilha de cartões de situação acima do objetivo (hud.js) — nada de cartões soltos por cima uns dos outros */
#pilha { position: fixed; left: 50%; transform: translateX(-50%); width: min(560px, calc(100vw - 24px)); z-index: 8; display: flex; flex-direction: column; gap: 6px; pointer-events: none; }
#pilha > * { pointer-events: auto; position: relative !important; transform: none !important; width: auto !important; max-width: none !important; margin: 0 !important; top: auto !important; bottom: auto !important; left: auto !important; right: auto !important; box-sizing: border-box; }
#pilha > .pilha-oculto { display: none !important; }
@media (max-height: 560px) { #pilha { width: min(400px, 44vw); } }
body.cabine #pilha, body.ecraLimpo #pilha .pilha-oculto { display: none !important; }
#pilhaMais { align-self: flex-end; pointer-events: auto; background: rgba(20,16,18,.92); color: #ffcb00; border: 1px solid #ffcb00; border-radius: 999px; padding: 3px 10px; font: 800 12px system-ui; }
#pilhaMais[hidden] { display: none; }
#pilha #evCard { padding: 6px 10px; }
/* v0.28: objetivo em 2 linhas no máximo e títulos compridos mais pequenos */
#obj .obj-txt { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.fx-banner.longo b { font-size: clamp(26px, 8vw, 44px); line-height: 1.1; max-width: 92vw; white-space: normal; }
.en-voc small { font-size: 12.5px !important; }
.en-voc-desc { width: 100%; box-sizing: border-box; margin: 0; padding: 10px 12px; border-radius: 12px; background: rgba(20,16,18,.8); border: 1px solid var(--painel2); font-size: 14px; text-align: left; min-height: 44px; }
.en-passo:has(#enVoc) { padding-bottom: calc(96px + env(safe-area-inset-bottom)); } /* a descrição do caminho não fica atrás do botão */
.en-voc-desc { scroll-margin-bottom: 96px; }
body.ocupado #obj, body.ocupado #objIr, body.ocupado #pilha, body.ocupado #btnAcao, body.ocupado #toasts .toast.info { visibility: hidden; }
.fx-banner.longo b { font-size: clamp(20px, 6.2vw, 34px); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 90vw; margin: 0 auto; }
@media (max-height: 560px) { #pilha { left: auto; right: calc(8px + env(safe-area-inset-right)); transform: none; width: min(300px, 34vw); } #pilha #evento .ev-txt small { display: none; } }
/* v0.29: dentro de uma app, as outras apps numa só fila que desliza (antes eram 5 filas e sobrava pouco ecrã) */
.tel-apps { display: flex !important; flex-wrap: nowrap; overflow-x: auto; gap: 6px; padding: 6px 8px; scrollbar-width: none; -webkit-overflow-scrolling: touch; }
.tel-apps::-webkit-scrollbar { display: none; }
.tel-apps button { flex: 0 0 auto; min-width: 60px; }
