/* O mapa do mundo de Neverslain — a marca do jogo (arte/marca/ESTILO.md): noite roxa e índigo, couro quente,
   lã crua, e a Faísca violeta (#8e86f4 / #6a58ff) como o único destaque saturado. Títulos em pixel (Pixelify Sans),
   texto em Alegreya Sans. O losango da Faísca é o símbolo. */
@font-face { font-family: 'Pixelify'; src: url('vendor/fonts/pixelify.woff2') format('woff2'); font-weight: 400 700; font-display: swap; }
@font-face { font-family: 'Alegreya Sans'; src: url('vendor/fonts/alegreya-400.woff2') format('woff2'); font-weight: 400; font-display: swap; }
@font-face { font-family: 'Alegreya Sans'; src: url('vendor/fonts/alegreya-500.woff2') format('woff2'); font-weight: 500; font-display: swap; }
@font-face { font-family: 'Alegreya Sans'; src: url('vendor/fonts/alegreya-700.woff2') format('woff2'); font-weight: 700; font-display: swap; }
@font-face { font-family: 'Alegreya Sans'; src: url('vendor/fonts/alegreya-italico.woff2') format('woff2'); font-weight: 400; font-style: italic; font-display: swap; }

:root {
  --breu: #14101c;
  --sombra: #2c2240;
  --noite: #3a3160;
  --indigo: #33307a;
  --nevoa: #514a7e;
  --penumbra: #857aa3;
  --la: #c8b0a0;
  --la2: #e6d9cc;
  --couro: #a8784c;
  --couro2: #7d5546;
  --pinho: #93684a;
  --lama: #54404a;
  --capim: #c09a5c;
  --tocha: #ffc85a;
  --raio: #8e86f4;
  --raio2: #6a58ff;
  --perola: #d0c4ec;
  --painel: rgba(20, 16, 28, .95);
  --moldura: 0 0 0 2px #1d1729, 0 0 0 4px var(--couro2), 0 0 0 5px #1d1729;
  --sombra-caixa: 0 14px 40px rgba(8, 5, 14, .6);
  --pixel: 'Pixelify', 'Silkscreen', monospace;
  --texto: 'Alegreya Sans', 'Trebuchet MS', sans-serif;
  --painel-w: 420px;
  --ease: cubic-bezier(.22, .8, .25, 1);
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
html, body { margin: 0; height: 100%; overflow: hidden; background: var(--breu); color: var(--la); font-family: var(--texto); -webkit-font-smoothing: antialiased; -webkit-tap-highlight-color: transparent; }
button, input, select { font: inherit; color: inherit; }
button { background: none; border: 0; cursor: pointer; padding: 0; }
svg { display: block; }

#fundo { position: fixed; inset: 0; background: radial-gradient(ellipse at 60% 40%, #2c2240 0%, #14101c 70%); }
#tela { position: fixed; inset: 0; width: 100%; height: 100%; display: block; touch-action: none; cursor: grab; opacity: 0; transition: opacity 1s ease; outline: none; }
body.pronto #tela { opacity: 1; }
#tela.arrastando { cursor: grabbing; }

/* ---------- Faísca (o losango violeta) */
.faisca-logo { display: inline-block; width: 14px; height: 14px; flex: none; clip-path: polygon(50% 0, 100% 50%, 50% 100%, 0 50%);
  background: radial-gradient(circle, #fff 0 12%, var(--perola) 16% 30%, var(--raio) 36% 62%, var(--raio2) 66%); filter: drop-shadow(0 0 6px rgba(142, 134, 244, .9)); }
.faisca-logo.grande { width: 30px; height: 30px; animation: pulsar 2.6s ease-in-out infinite; }
@keyframes pulsar { 50% { transform: scale(1.12); filter: drop-shadow(0 0 14px rgba(142, 134, 244, 1)); } }

/* ---------- rótulos */
#rotulos { position: fixed; inset: 0; pointer-events: none; overflow: hidden; z-index: 2; opacity: 0; transition: opacity 1.2s ease .6s; }
body.explorando #rotulos { opacity: 1; }
.rot { position: absolute; left: 0; top: 0; opacity: 0; will-change: transform, opacity; transition: opacity .35s ease; }
.rot:not(.vis) { visibility: hidden; }
.rot .corpo { position: absolute; left: 0; top: 0; white-space: nowrap; pointer-events: auto; text-align: center; }
.rot-mar .corpo { pointer-events: none; }
.sombra-texto, .rot b, .rot span, .rot em { text-shadow: 0 0 2px var(--breu), 0 1px 0 var(--breu), 0 0 10px rgba(20, 16, 28, .95), 0 0 22px rgba(20, 16, 28, .6); }
.rot-continente .corpo { transform: translate(-50%, -50%); cursor: pointer; }
.rot-continente b { display: block; font-family: var(--pixel); font-weight: 600; font-size: clamp(19px, 2.1vw, 30px); letter-spacing: .2em; text-indent: .2em; color: var(--la2); text-transform: uppercase; }
.rot-continente em { display: block; margin-top: 1px; font-style: italic; font-size: clamp(14px, 1.3vw, 18px); color: var(--perola); }
.rot-continente .corpo:hover b { color: #fff; }
.rot-mar .corpo { transform: translate(-50%, -50%); font-style: italic; font-size: 15px; letter-spacing: .3em; text-indent: .3em; color: rgba(208, 196, 236, .5); text-transform: uppercase; }

.rot-terra .corpo { transform: translate(-50%, -27px); cursor: pointer; display: flex; flex-direction: column; align-items: center; }
.rot-terra b { margin-top: 6px; font-family: var(--pixel); font-weight: 600; font-size: 15px; letter-spacing: .12em; text-indent: .12em; color: var(--la2); text-transform: uppercase; }
.rot-terra em { font-style: italic; font-size: 14px; color: var(--perola); opacity: .9; }
.rot-terra .guia { position: absolute; left: 50%; top: 27px; height: 2px; transform-origin: 0 50%; background: repeating-linear-gradient(90deg, rgba(200, 176, 160, .8) 0 4px, transparent 4px 7px); pointer-events: none; z-index: -1; }
.rot-terra .guia::after { content: ''; position: absolute; right: -4px; top: -3px; width: 8px; height: 8px; background: var(--la); clip-path: polygon(50% 0, 100% 50%, 50% 100%, 0 50%); }
.rot-terra.sob .emblema { opacity: .85; }
.rot-terra.sob .emblema::before { background: repeating-conic-gradient(var(--couro2) 0 10deg, #1d1729 10deg 20deg); }
.rot-terra .corpo:hover .emblema, .rot-terra.ativo .emblema, .rot-terra.aceso .emblema { transform: scale(1.14); filter: drop-shadow(0 0 10px rgba(142, 134, 244, .85)); }
.rot-terra .corpo:hover .emblema::before, .rot-terra.ativo .emblema::before, .rot-terra.aceso .emblema::before { background: linear-gradient(135deg, var(--perola), var(--raio) 45%, var(--raio2)); }
.rot-terra.ativo b, .rot-terra.aceso b { color: #fff; }

.rot-cidade .corpo, .rot-lugar .corpo { transform: translate(-50%, -7px); cursor: pointer; display: flex; flex-direction: column; align-items: center; }
.rot-cidade .ponto { width: 7px; height: 7px; background: var(--la2); box-shadow: 0 0 0 2px var(--breu); margin: 3px 0 3px; }
.rot-capital .ponto { width: 12px; height: 12px; margin: 0 0 2px; background: var(--tocha); clip-path: polygon(50% 0, 100% 50%, 50% 100%, 0 50%); box-shadow: none; filter: drop-shadow(0 0 3px var(--breu)) drop-shadow(0 0 6px rgba(255, 200, 90, .55)); }
.rot-grande .ponto { width: 9px; height: 9px; background: var(--capim); box-shadow: 0 0 0 2px var(--breu); }
.rot-cidade span, .rot-lugar span { font-weight: 700; font-size: 15px; color: var(--la2); }
.rot-capital span { font-family: var(--pixel); font-weight: 600; font-size: 14px; letter-spacing: .08em; text-transform: uppercase; color: #fff1d8; }
.rot-menor span { font-size: 14px; font-weight: 500; color: var(--la); }
.rot-lugar .ponto { font-style: normal; font-size: 11px; line-height: 12px; color: var(--la); margin-bottom: 1px; }
.rot-lugar span { font-style: italic; font-weight: 500; color: var(--la); }
.rot-unico .ponto.faisca, .rot-raro .ponto.losango { width: 13px; height: 13px; margin: 0 0 2px; clip-path: polygon(50% 0, 100% 50%, 50% 100%, 0 50%); }
.rot-unico .ponto.faisca { background: radial-gradient(circle, #fff 0 15%, var(--perola) 20% 34%, var(--raio) 40% 64%, var(--raio2) 68%); filter: drop-shadow(0 0 6px rgba(142, 134, 244, .95)); animation: pulsar 2.4s ease-in-out infinite; }
.rot-unico span { color: var(--perola); font-weight: 700; font-style: normal; }
.rot-raro .ponto.losango { width: 11px; height: 11px; background: var(--raio); -webkit-mask: radial-gradient(circle, transparent 0 22%, #000 26%); mask: radial-gradient(circle, transparent 0 22%, #000 26%); }
.rot-raro span { color: var(--perola); font-size: 13.5px; }
.rot-cidade .corpo:hover span, .rot-lugar .corpo:hover span, .rot.ativo span { color: #fff; }
.rot.ativo .ponto { outline: 2px solid var(--raio); outline-offset: 2px; }

/* ---------- emblema: losango com moldura de couro e o símbolo em lã crua */
.emblema { position: relative; display: inline-grid; place-items: center; flex: none; transition: transform .25s var(--ease), filter .25s ease; }
.emblema::before { content: ''; position: absolute; inset: 0; clip-path: polygon(50% 0, 100% 50%, 50% 100%, 0 50%); background: linear-gradient(135deg, #c99a6a, var(--couro) 35%, var(--couro2) 70%, var(--lama)); }
.emblema::after { content: ''; position: absolute; inset: 4px; clip-path: polygon(50% 0, 100% 50%, 50% 100%, 0 50%); background: radial-gradient(circle at 50% 40%, var(--noite), var(--sombra) 55%, var(--breu)); }
.emblema svg { position: relative; z-index: 1; width: 50%; height: 50%; fill: none; stroke: var(--la2); stroke-width: 3; stroke-linecap: square; stroke-linejoin: miter; }
.emblema img { position: relative; z-index: 1; width: 55%; height: 55%; object-fit: contain; }
.emblema-m { width: 56px; height: 56px; filter: drop-shadow(0 4px 6px rgba(10, 6, 18, .7)); }
.emblema-g { width: 92px; height: 92px; }
.emblema-g::after { inset: 6px; }
.emblema-g svg { stroke-width: 2.5; }
.emblema-p { width: 26px; height: 26px; }
.emblema-p::after { inset: 2.5px; }
.emblema-p svg { stroke-width: 4.5; width: 54%; height: 54%; }

/* ---------- marca e trilho */
#marca { position: fixed; left: 78px; top: 20px; z-index: 5; pointer-events: none; opacity: 0; transform: translateY(-8px); transition: opacity 1s ease .9s, transform 1s var(--ease) .9s; }
body.explorando #marca { opacity: 1; transform: none; }
#marca .logo { margin: 0; line-height: 0; }
#marca .logo img, .entrada-logo img { image-rendering: pixelated; image-rendering: crisp-edges; display: block; filter: drop-shadow(0 3px 0 rgba(20, 16, 28, .9)) drop-shadow(0 0 14px rgba(20, 16, 28, .8)); }
#marca .logo img { width: 377px; height: 79px; transform-origin: 0 0; }
#marca .sub { margin: 4px 0 0 6px; font-size: 16px; color: var(--perola); text-shadow: 0 1px 8px var(--breu); }

#trilho { position: fixed; left: 0; top: 0; bottom: 0; width: 58px; z-index: 6; display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 90px 0 20px;
  background: linear-gradient(90deg, rgba(20, 16, 28, .96), rgba(28, 22, 40, .9)); border-right: 2px solid var(--couro2); box-shadow: 2px 0 0 #1d1729;
  transform: translateX(-100%); transition: transform .9s var(--ease) .7s; }
body.explorando #trilho { transform: none; }
#trilho::before { content: ''; position: absolute; top: 26px; left: 50%; width: 26px; height: 26px; transform: translateX(-50%); clip-path: polygon(50% 0, 100% 50%, 50% 100%, 0 50%);
  background: radial-gradient(circle, #fff 0 12%, var(--perola) 16% 30%, var(--raio) 36% 62%, var(--raio2) 66%); }
#trilho button { position: relative; width: 42px; height: 42px; display: grid; place-items: center; color: var(--la); transition: color .2s, background .2s, box-shadow .2s; }
#trilho button svg { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: square; stroke-linejoin: miter; }
#trilho button .cheio, #convite .cheio, #zoom .cheio { fill: currentColor; stroke: none; }
#trilho button:hover { color: #fff; background: rgba(142, 134, 244, .1); }
#trilho button.ativo { color: #fff; background: rgba(106, 88, 255, .22); box-shadow: inset 2px 0 0 var(--raio), 0 0 0 1px rgba(142, 134, 244, .35); }
#trilho button::after { content: attr(title); position: absolute; left: 54px; top: 50%; transform: translate(-4px, -50%); white-space: nowrap; padding: 6px 11px;
  background: var(--breu); box-shadow: 0 0 0 2px var(--couro2); font-size: 15px; color: var(--la2); opacity: 0; pointer-events: none; transition: opacity .15s, transform .15s; }
#trilho button:hover::after { opacity: 1; transform: translate(0, -50%); }
#trilho .sep { width: 22px; height: 2px; background: var(--couro2); margin: 6px 0; }
#b-lingua span { font-family: var(--pixel); font-size: 13px; letter-spacing: .06em; font-weight: 600; }
#b-som .onda { display: none; }
#b-som.ativo .onda { display: block; }
#b-som.ativo .mudo { display: none; }

#zoom { position: fixed; right: 24px; bottom: 76px; z-index: 5; display: flex; flex-direction: column; background: var(--painel); box-shadow: var(--moldura);
  opacity: 0; transition: opacity 1s ease 1.1s, right .55s var(--ease); }
body.explorando #zoom { opacity: 1; }
#zoom button { width: 40px; height: 40px; display: grid; place-items: center; color: var(--la); }
#zoom button + button { border-top: 2px solid var(--couro2); }
#zoom button:hover { color: #fff; background: rgba(142, 134, 244, .12); }
#zoom svg { width: 18px; height: 18px; stroke: currentColor; stroke-width: 1.8; fill: none; stroke-linecap: square; transition: transform .2s; }
#b-bussola .cheio { fill: var(--raio); }
#b-bussola.girado { background: rgba(106, 88, 255, .18); }
body.com-painel #zoom { right: calc(var(--painel-w) + 26px); }

/* ---------- convite (Discord e Steam) */
#convite { position: fixed; right: 24px; bottom: 20px; z-index: 5; display: flex; align-items: center; gap: 10px; opacity: 0; transition: opacity 1s ease 1.3s, right .55s var(--ease); }
body.explorando #convite { opacity: 1; }
body.com-painel #convite { right: calc(var(--painel-w) + 26px); }
#convite-texto { font-style: italic; font-size: 15px; color: var(--penumbra); margin-right: 4px; text-shadow: 0 1px 6px var(--breu); }
#convite a { display: inline-flex; align-items: center; gap: 8px; height: 34px; padding: 0 13px; text-decoration: none; font-family: var(--pixel); font-size: 13px; letter-spacing: .06em;
  color: var(--la2); background: var(--painel); box-shadow: var(--moldura); cursor: pointer; transition: color .2s, box-shadow .2s; }
#convite a.destaque { color: #fff; background: linear-gradient(180deg, #3d3280, #2a2160); box-shadow: 0 0 0 2px #1d1729, 0 0 0 4px var(--raio2), 0 0 0 5px #1d1729, 0 0 18px rgba(106, 88, 255, .35); }
#convite a:hover { color: #fff; }
#convite a[aria-disabled] { cursor: default; opacity: .8; }
#convite svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linejoin: miter; }
#aviso-prov { position: fixed; left: 78px; bottom: 18px; z-index: 5; font-style: italic; font-size: 13px; color: var(--penumbra); }

/* ---------- dica do bioma sob o mouse */
#dica { position: fixed; left: 0; top: 0; z-index: 9; pointer-events: none; display: flex; align-items: center; gap: 8px; padding: 6px 11px 6px 8px; max-width: 280px;
  background: var(--painel); box-shadow: var(--moldura); font-size: 15px; white-space: nowrap; }
#dica b { font-weight: 700; color: var(--la2); overflow: hidden; text-overflow: ellipsis; }
#dica span:last-child { font-style: italic; font-size: 13px; color: var(--penumbra); }
.amostra { display: inline-block; flex: none; width: 14px; height: 14px; background: linear-gradient(135deg, var(--c1) 0 50%, var(--c2) 50%); box-shadow: 0 0 0 2px var(--breu), 0 0 0 3px var(--couro2); }

/* ---------- painel lateral */
#painel { position: fixed; top: 0; right: 0; bottom: 0; width: var(--painel-w); z-index: 8; transform: translateX(104%); transition: transform .55s var(--ease); pointer-events: none; }
#painel.aberto { transform: none; pointer-events: auto; }
.painel-moldura { position: absolute; inset: 0; display: flex; flex-direction: column; background: linear-gradient(180deg, rgba(36, 28, 52, .97), rgba(20, 16, 28, .98));
  border-left: 3px solid var(--couro2); box-shadow: -2px 0 0 #1d1729, var(--sombra-caixa); }
#painel-conteudo { flex: 1; overflow-y: auto; padding: 44px 34px 22px; scrollbar-width: thin; scrollbar-color: var(--couro2) transparent; }
#painel .fechar, .gaveta-cabeca .fechar, .ajuda-caixa .fechar { position: absolute; top: 12px; right: 14px; width: 36px; height: 36px; font-family: var(--pixel); font-size: 24px; line-height: 1; color: var(--la); z-index: 2; }
#painel .fechar:hover, .gaveta-cabeca .fechar:hover, .ajuda-caixa .fechar:hover { color: #fff; background: rgba(142, 134, 244, .14); }
.cabeca { text-align: center; padding-bottom: 18px; margin-bottom: 18px; position: relative; }
.cabeca::after { content: ''; position: absolute; left: 50%; bottom: 0; width: 180px; height: 10px; transform: translateX(-50%);
  background: linear-gradient(90deg, transparent, var(--couro2) 25% 44%, transparent 44% 56%, var(--couro2) 56% 75%, transparent) center / 100% 2px no-repeat; }
.cabeca::before { content: ''; position: absolute; left: 50%; bottom: -1px; width: 12px; height: 12px; transform: translateX(-50%); clip-path: polygon(50% 0, 100% 50%, 50% 100%, 0 50%); background: var(--raio); }
.cabeca .emblema { margin: 0 auto 14px; }
.cabeca .emblema-p { margin-bottom: 10px; width: 34px; height: 34px; }
.cabeca-bioma .amostra { width: 54px; height: 54px; margin: 0 auto 14px; display: block; box-shadow: 0 0 0 3px var(--breu), 0 0 0 6px var(--couro2), 0 8px 18px rgba(0, 0, 0, .5); }
.kicker { font-family: var(--pixel); font-size: 13px; letter-spacing: .14em; text-transform: uppercase; color: var(--couro); }
.kicker .link { color: var(--perola); letter-spacing: inherit; text-transform: inherit; font-size: inherit; border-bottom: 2px solid transparent; }
.kicker .link:hover { border-color: var(--raio); }
#painel h2 { margin: 6px 0 2px; font-family: var(--pixel); font-weight: 600; font-size: 30px; letter-spacing: .06em; color: #fff3e2; line-height: 1.1; }
.subtitulo { font-style: italic; font-size: 19px; color: var(--perola); }
.selo-raridade { display: inline-flex; align-items: center; gap: 7px; margin-top: 8px; padding: 3px 10px; font-family: var(--pixel); font-size: 12.5px; letter-spacing: .1em; text-transform: uppercase; color: var(--la); box-shadow: 0 0 0 2px var(--lama); }
.selo-raridade.raro { color: var(--perola); box-shadow: 0 0 0 2px var(--nevoa); }
.selo-raridade.unica { color: #fff; box-shadow: 0 0 0 2px var(--raio2), 0 0 14px rgba(106, 88, 255, .5); }
.selo-raridade i { width: 10px; height: 10px; clip-path: polygon(50% 0, 100% 50%, 50% 100%, 0 50%); background: var(--raio); }
.lead { font-size: 19px; line-height: 1.45; color: var(--la2); margin: 0 0 18px; }
.ficha { margin: 0 0 8px; border-top: 2px solid var(--lama); }
.ficha-linha { display: grid; grid-template-columns: 108px 1fr; gap: 12px; padding: 9px 0; border-bottom: 2px solid rgba(84, 64, 74, .6); }
.ficha dt { font-family: var(--pixel); font-size: 12.5px; letter-spacing: .1em; text-transform: uppercase; color: var(--couro); padding-top: 3px; }
.ficha dd { margin: 0; font-size: 16.5px; line-height: 1.4; color: var(--la2); }
.ficha dd .chip { margin: 0; }
#painel h3 { margin: 24px 0 10px; font-family: var(--pixel); font-weight: 600; font-size: 15px; letter-spacing: .12em; text-transform: uppercase; color: var(--perola); display: flex; align-items: center; gap: 12px; }
#painel h3::after { content: ''; flex: 1; height: 2px; background: linear-gradient(90deg, var(--couro2), transparent); }
.texto p { font-size: 17px; line-height: 1.55; color: var(--la); margin: 0 0 12px; }
.chips { display: flex; flex-wrap: wrap; gap: 10px; }
.chip { display: inline-flex; align-items: center; gap: 8px; padding: 5px 12px 5px 7px; min-height: 34px; background: rgba(58, 49, 96, .45); box-shadow: 0 0 0 2px var(--couro2); font-size: 15.5px; font-weight: 700; color: var(--la2); transition: box-shadow .2s, background .2s; }
.chip:not(:has(.emblema)) { padding-left: 12px; }
.chip:hover { box-shadow: 0 0 0 2px var(--raio); background: rgba(106, 88, 255, .2); color: #fff; }
.tracos { display: flex; flex-wrap: wrap; justify-content: center; gap: 6px 14px; margin: -6px 0 18px; }
.tracos span { font-family: var(--pixel); font-size: 12.5px; letter-spacing: .12em; text-transform: uppercase; color: var(--couro); }
.tracos span + span::before { content: ''; display: inline-block; width: 6px; height: 6px; margin-right: 14px; background: var(--raio); clip-path: polygon(50% 0, 100% 50%, 50% 100%, 0 50%); vertical-align: 2px; }
.lista-cidades { list-style: none; margin: 0; padding: 0; columns: 2; column-gap: 14px; }
.lista-cidades li { break-inside: avoid; }
.lista-cidades button { display: flex; align-items: center; gap: 9px; width: 100%; padding: 5px 4px; text-align: left; font-size: 16px; font-weight: 700; color: var(--la2); }
.lista-cidades button:hover { background: rgba(142, 134, 244, .12); color: #fff; }
.lista-cidades small { margin-left: auto; font-style: italic; font-weight: 400; font-size: 13px; color: var(--penumbra); }
.lista-cidades li:not(:first-child) small { display: none; }
.lista-cidades i { width: 7px; height: 7px; background: var(--la); flex: none; }
.lista-cidades .marca-capital { width: 11px; height: 11px; background: var(--tocha); clip-path: polygon(50% 0, 100% 50%, 50% 100%, 0 50%); }
.lista-cidades .marca-grande { width: 9px; height: 9px; background: var(--capim); }
#painel-link { display: flex; align-items: center; justify-content: center; gap: 10px; margin: 0 34px 22px; height: 42px; box-shadow: var(--moldura); font-family: var(--pixel); font-size: 13px; letter-spacing: .08em; color: var(--la); transition: all .2s; }
#painel-link svg { width: 17px; height: 17px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: square; }
#painel-link:hover, #painel-link.ok { color: #fff; box-shadow: 0 0 0 2px #1d1729, 0 0 0 4px var(--raio), 0 0 0 5px #1d1729; }

/* ---------- gavetas (povos e biomas) */
#povos, #biomas { position: fixed; top: 0; bottom: 0; left: 58px; width: 340px; z-index: 7; display: flex; flex-direction: column;
  background: linear-gradient(180deg, rgba(36, 28, 52, .97), rgba(20, 16, 28, .97)); border-right: 3px solid var(--couro2); box-shadow: 2px 0 0 #1d1729, var(--sombra-caixa);
  transform: translateX(-110%); transition: transform .5s var(--ease); visibility: hidden; }
#povos.aberto, #biomas.aberto { transform: none; visibility: visible; }
.gaveta-cabeca { position: relative; padding: 28px 24px 16px; border-bottom: 2px solid var(--couro2); }
.gaveta-cabeca h2 { margin: 0; font-family: var(--pixel); font-weight: 600; font-size: 20px; letter-spacing: .08em; color: #fff3e2; }
.gaveta-cabeca p { margin: 6px 0 0; font-style: italic; font-size: 16px; color: var(--penumbra); }
#biomas-contador { margin-top: 10px; font-family: var(--pixel); font-size: 14px; letter-spacing: .08em; text-transform: uppercase; color: var(--couro); }
#biomas-contador b { font-size: 26px; color: var(--perola); margin-right: 4px; vertical-align: -3px; }
.filtros { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 14px; }
.filtros input { grid-column: 1 / -1; }
.filtros input, .filtros select { width: 100%; height: 34px; padding: 0 10px; background: var(--breu); border: 0; box-shadow: 0 0 0 2px var(--couro2); color: var(--la2); font-size: 15px; outline: none; border-radius: 0; }
.filtros input:focus, .filtros select:focus { box-shadow: 0 0 0 2px var(--raio); }
.filtros select { appearance: none; -webkit-appearance: none; background-image: linear-gradient(45deg, transparent 50%, var(--la) 50%), linear-gradient(135deg, var(--la) 50%, transparent 50%); background-position: calc(100% - 15px) 15px, calc(100% - 10px) 15px; background-size: 5px 5px; background-repeat: no-repeat; padding-right: 24px; text-overflow: ellipsis; }
#povos-lista, #biomas-lista { list-style: none; margin: 0; padding: 10px 12px 30px; overflow-y: auto; flex: 1; scrollbar-width: thin; scrollbar-color: var(--couro2) transparent; }
#povos-lista .grupo { font-family: var(--pixel); font-size: 13px; letter-spacing: .14em; text-transform: uppercase; color: var(--couro); padding: 16px 14px 6px; }
#povos-lista button, #biomas-lista button { display: flex; align-items: center; gap: 12px; width: 100%; text-align: left; padding: 8px 12px; border-left: 3px solid transparent; transition: background .2s, border-color .2s; }
#povos-lista button { display: block; }
#povos-lista button b, #biomas-lista button b { display: block; font-size: 18px; font-weight: 700; color: var(--la2); line-height: 1.15; }
#povos-lista button span, #biomas-lista .txt span { display: block; font-style: italic; font-size: 14px; color: var(--penumbra); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
#biomas-lista .txt { flex: 1; min-width: 0; }
#biomas-lista b { font-size: 16.5px !important; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
#povos-lista button:hover, #biomas-lista button:hover { background: rgba(142, 134, 244, .1); }
#povos-lista button.ativo, #biomas-lista button.ativo { background: rgba(106, 88, 255, .2); border-left-color: var(--raio); }
#povos-lista button.ativo b, #biomas-lista button.ativo b { color: #fff; }
.marca-rara { width: 12px; height: 12px; flex: none; clip-path: polygon(50% 0, 100% 50%, 50% 100%, 0 50%); background: var(--nevoa); }
.marca-rara.raro { background: var(--penumbra); }
.marca-rara.unica { background: radial-gradient(circle, #fff 0 15%, var(--raio) 25%, var(--raio2)); filter: drop-shadow(0 0 4px var(--raio)); }

/* ---------- entrada: o mundo girando sob a névoa, o texto no canto */
#entrada { position: fixed; inset: 0; z-index: 20; display: flex; align-items: flex-end; padding: 0 0 9vh 7vw; pointer-events: none;
  background: linear-gradient(90deg, rgba(20, 16, 28, .82) 0%, rgba(20, 16, 28, .35) 45%, rgba(20, 16, 28, 0) 70%), linear-gradient(0deg, rgba(20, 16, 28, .7), transparent 45%);
  transition: opacity 1.2s ease, visibility 1.2s; }
#entrada.saindo { opacity: 0; visibility: hidden; }
.entrada-caixa { max-width: 560px; pointer-events: auto; transition: transform 1.4s var(--ease); }
#entrada.saindo .entrada-caixa { transform: translateX(-30px); }
.entrada-logo { animation: surgir 1.6s var(--ease) both; margin-left: -6px; }
.entrada-logo img { width: 754px; height: 158px; max-width: none; }
@media (max-width: 1100px) { .entrada-logo img { width: 377px; height: 79px; } }
body.cinema #entrada .entrada-caixa > * { animation-delay: 6.8s !important; animation-duration: 2s !important; }
body.cinema #entrada .entrada-caixa > *:nth-child(2) { animation-delay: 7.1s !important; }
body.cinema #entrada .entrada-caixa > *:nth-child(3) { animation-delay: 7.4s !important; }
body.cinema #entrada .entrada-caixa > *:nth-child(4) { animation-delay: 7.7s !important; }
body.cinema #entrada .entrada-caixa > *:nth-child(5) { animation-delay: 8s !important; }
body.cinema-fim #entrada .entrada-caixa > * { animation-delay: 0s !important; }
body.sem-rotulos #rotulos { opacity: 0 !important; }
.entrada-titulo { margin: 16px 0 0 4px; font-family: var(--pixel); font-size: clamp(14px, 1.5vw, 18px); letter-spacing: .26em; text-transform: uppercase; color: var(--couro); animation: surgir 1.6s var(--ease) .25s both; }
#entrada h1 { margin: 22px 0 10px; font-weight: 500; font-style: italic; font-size: clamp(24px, 3vw, 34px); line-height: 1.2; color: var(--la2); text-shadow: 0 2px 14px var(--breu); animation: surgir 1.6s var(--ease) .45s both; }
#entrada-intro { margin: 0; max-width: 500px; font-size: clamp(16px, 1.55vw, 18.5px); line-height: 1.5; color: var(--la); text-shadow: 0 1px 10px var(--breu); animation: surgir 1.6s var(--ease) .6s both; }
#b-explorar { display: inline-flex; align-items: center; gap: 14px; margin-top: 30px; padding: 0 30px 0 22px; height: 56px; font-family: var(--pixel); font-weight: 600; font-size: 18px; letter-spacing: .1em; text-transform: uppercase; color: #fff;
  background: linear-gradient(180deg, #4a3d94 0%, #33307a 55%, #2a2160 100%);
  box-shadow: 0 0 0 2px #1d1729, 0 0 0 4px var(--raio2), 0 0 0 6px #1d1729, 0 6px 0 6px rgba(20, 16, 28, .6), 0 0 40px rgba(106, 88, 255, .35);
  animation: surgir 1.6s var(--ease) .8s both; transition: transform .15s, filter .2s; }
#b-explorar .faisca-logo { width: 18px; height: 18px; }
#b-explorar:hover { transform: translateY(-2px); filter: brightness(1.12); }
#b-explorar:active { transform: translateY(1px); }
#b-explorar:disabled { filter: grayscale(.5) brightness(.7); cursor: wait; }
@keyframes surgir { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: none; } }

#b-pular { position: fixed; right: 24px; bottom: 22px; z-index: 22; padding: 8px 14px; font-family: var(--pixel); font-size: 14px; letter-spacing: .08em; color: var(--la); background: rgba(20, 16, 28, .6); box-shadow: 0 0 0 2px rgba(125, 85, 70, .7); opacity: .75; }
#b-pular:hover { opacity: 1; color: #fff; }
body.cinema-fim #b-pular { display: none; }

/* ---------- galeria dos povos */
.galeria-mini { position: relative; display: block; width: 100%; aspect-ratio: 3 / 2; margin: 0 0 18px; padding: 0; overflow: hidden; background: var(--breu); box-shadow: var(--moldura); cursor: zoom-in; }
.galeria-mini img { width: 100%; height: 100%; object-fit: cover; display: block; transition: transform .4s var(--ease); }
.galeria-mini:hover img { transform: scale(1.04); }
.galeria-mini .lupa { position: absolute; right: 8px; bottom: 8px; width: 14px; height: 14px; clip-path: polygon(50% 0, 100% 50%, 50% 100%, 0 50%); background: var(--raio); filter: drop-shadow(0 0 6px var(--raio)); }
#galeria { position: fixed; inset: 0; z-index: 35; display: grid; place-items: center; padding: 30px 80px; background: rgba(12, 8, 20, .88); }
#galeria figure { margin: 0; display: flex; flex-direction: column; align-items: center; max-width: 100%; max-height: 100%; }
#galeria img { display: block; max-width: min(1536px, 100%); max-height: calc(100vh - 150px); width: auto; height: auto; box-shadow: var(--moldura), var(--sombra-caixa); transition: opacity .25s; }
#galeria img.trocando { opacity: .35; }
@media (min-width: 1700px) and (min-height: 1150px) { #galeria img { image-rendering: pixelated; } }
#galeria figcaption { display: flex; align-items: baseline; gap: 14px; flex-wrap: wrap; justify-content: center; max-width: 1100px; margin-top: 16px; text-align: center; }
#galeria figcaption b { font-family: var(--pixel); font-weight: 600; font-size: 17px; letter-spacing: .08em; color: #fff3e2; }
#galeria figcaption span { font-size: 17px; color: var(--la2); font-style: italic; }
#galeria figcaption small { font-family: var(--pixel); font-size: 12px; color: var(--penumbra); }
#galeria-ant, #galeria-prox { position: absolute; top: 50%; transform: translateY(-50%); width: 48px; height: 64px; font-family: var(--pixel); font-size: 40px; color: var(--la2); background: var(--painel); box-shadow: var(--moldura); }
#galeria-ant { left: 18px; } #galeria-prox { right: 18px; }
#galeria-ant:hover, #galeria-prox:hover { color: #fff; box-shadow: 0 0 0 2px #1d1729, 0 0 0 4px var(--raio), 0 0 0 5px #1d1729; }
#galeria .fechar { position: absolute; top: 16px; right: 18px; width: 40px; height: 40px; font-family: var(--pixel); font-size: 28px; color: var(--la2); }

/* ---------- ajustes e dicas */
#ajustes { position: fixed; left: 72px; bottom: 70px; z-index: 12; width: 300px; padding: 18px 20px 14px; background: var(--painel); box-shadow: var(--moldura), var(--sombra-caixa); }
#ajustes h2 { margin: 0 0 10px; font-family: var(--pixel); font-weight: 600; font-size: 17px; letter-spacing: .08em; color: #fff3e2; }
#ajustes label { display: flex; align-items: center; gap: 10px; padding: 7px 0; font-size: 15.5px; color: var(--la2); cursor: pointer; }
#ajustes input { appearance: none; -webkit-appearance: none; width: 16px; height: 16px; flex: none; margin: 0; background: var(--breu); box-shadow: 0 0 0 2px var(--couro2); cursor: pointer; }
#ajustes input:checked { background: var(--raio); box-shadow: 0 0 0 2px var(--raio2), 0 0 8px rgba(142, 134, 244, .6); clip-path: none; }
#aviso-dica { position: fixed; left: 50%; bottom: 84px; z-index: 11; transform: translateX(-50%); padding: 10px 18px; background: var(--painel); box-shadow: var(--moldura), var(--sombra-caixa); font-size: 16.5px; color: var(--la2); white-space: nowrap; opacity: 0; pointer-events: none; }
#aviso-dica.entra { animation: dicaEntra .5s var(--ease) forwards; }
#aviso-dica.sai { animation: dicaSai .5s ease forwards; }
@keyframes dicaEntra { from { opacity: 0; transform: translate(-50%, 10px); } to { opacity: 1; transform: translate(-50%, 0); } }
@keyframes dicaSai { from { opacity: 1; } to { opacity: 0; transform: translate(-50%, 6px); } }
:focus-visible { outline: 2px solid var(--raio); outline-offset: 2px; }

/* ---------- ajuda e erro */
#ajuda { position: fixed; inset: 0; z-index: 30; display: grid; place-items: center; background: rgba(12, 8, 20, .6); padding: 20px; }
.ajuda-caixa { position: relative; width: min(520px, 100%); padding: 32px 32px 24px; background: linear-gradient(180deg, #241c34, #14101c); box-shadow: var(--moldura), var(--sombra-caixa); }
.ajuda-caixa h2 { margin: 0 0 16px; font-family: var(--pixel); font-weight: 600; font-size: 21px; letter-spacing: .08em; color: #fff3e2; }
#ajuda-lista { list-style: none; margin: 0; padding: 0; }
#ajuda-lista li { display: grid; grid-template-columns: 190px 1fr; gap: 12px; padding: 8px 0; border-top: 2px solid rgba(84, 64, 74, .7); font-size: 16px; }
#ajuda-lista b { font-weight: 700; color: var(--la2); }
#ajuda-lista span { color: var(--la); }
#erro, #erro-js { position: fixed; inset: auto 20px 20px; z-index: 40; padding: 14px 18px; background: var(--sombra); box-shadow: var(--moldura); color: var(--la2); font-size: 17px; text-align: center; }

body.em-globo #rotulos .rot-mar { display: none; }

/* ---------- celular */
@media (max-width: 760px) {
  :root { --painel-w: 100vw; }
  #marca { left: 16px; top: max(14px, env(safe-area-inset-top)); }
  #marca .logo img { width: 188px; height: 39px; image-rendering: auto; }
  #marca .sub { font-size: 14px; }
  #trilho { top: auto; bottom: 0; left: 0; right: 0; width: auto; height: calc(58px + env(safe-area-inset-bottom)); flex-direction: row; justify-content: space-around; padding: 0 6px env(safe-area-inset-bottom);
    border-right: 0; border-top: 3px solid var(--couro2); box-shadow: 0 -2px 0 #1d1729; transform: translateY(100%); }
  #trilho::before { display: none; }
  #trilho .sep { width: 2px; height: 22px; margin: 0; }
  #trilho button::after { display: none; }
  #zoom { right: 12px; bottom: calc(134px + env(safe-area-inset-bottom)); }
  #convite { right: 12px; left: 12px; bottom: calc(72px + env(safe-area-inset-bottom)); justify-content: flex-end; }
  #convite-texto { display: none; }
  #convite a { height: 32px; padding: 0 10px; font-size: 12px; }
  body.com-painel #zoom, body.com-painel #convite { right: 12px; opacity: 0; pointer-events: none; }
  #aviso-prov { left: 16px; bottom: auto; top: calc(58px + env(safe-area-inset-top)); }
  #painel { top: auto; height: 72vh; width: 100%; transform: translateY(104%); }
  #painel.aberto { transform: none; }
  .painel-moldura { border-left: 0; border-top: 3px solid var(--couro2); box-shadow: 0 -2px 0 #1d1729, var(--sombra-caixa); }
  #painel-conteudo { padding: 30px 20px 14px; }
  #painel h2 { font-size: 25px; }
  .lead { font-size: 17.5px; }
  #painel-link { margin: 0 20px calc(14px + env(safe-area-inset-bottom)); }
  #povos, #biomas { left: 0; right: 0; width: auto; bottom: calc(58px + env(safe-area-inset-bottom)); }
  .rot-continente b { font-size: 16px; letter-spacing: .16em; }
  .rot-continente em { font-size: 13px; }
  .rot-terra b { font-size: 12.5px; }
  .rot-terra em { display: none; }
  .emblema-m { width: 44px; height: 44px; }
  #entrada { padding: 0 22px calc(28px + env(safe-area-inset-bottom)); background: linear-gradient(0deg, rgba(20, 16, 28, .92) 0%, rgba(20, 16, 28, .55) 55%, transparent 80%); }
  #ajuda-lista li { grid-template-columns: 1fr; gap: 2px; }
  #dica { display: none !important; }
  #galeria { padding: 60px 0 20px; }
  #galeria img { max-width: 100%; max-height: calc(100vh - 220px); }
  #galeria figcaption { padding: 0 16px; }
  #galeria-ant, #galeria-prox { top: auto; bottom: 18px; transform: none; }
  #ajustes { left: 12px; right: 12px; width: auto; bottom: calc(70px + env(safe-area-inset-bottom)); }
  #aviso-dica { bottom: calc(118px + env(safe-area-inset-bottom)); white-space: normal; width: calc(100% - 40px); text-align: center; }
}
@media (prefers-reduced-motion: reduce) { * { animation-duration: .01s !important; transition-duration: .01s !important; } }
