/* NomiPlay Aventuras: interface (pensada para toque, letras grandes e alto contraste) */
:root { --tinta: #1e1b4b; --amarelo: #facc15; --azul: #2563eb; --verde: #22c55e; --fundo: rgba(255,255,255,.96); --sombra: 0 10px 30px rgba(15,23,42,.35); }
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; height: 100%; overflow: hidden; background: #0b1026; font-family: 'Fredoka', 'Nunito', system-ui, sans-serif; color: var(--tinta); touch-action: none; user-select: none; -webkit-user-select: none; }
#tela { position: fixed; inset: 0; width: 100%; height: 100%; display: block; }
#ui { position: fixed; inset: 0; pointer-events: none; }
#ui > * { pointer-events: auto; }
.oculto { display: none !important; }

/* carregando */
#carregando { position: fixed; inset: 0; z-index: 50; display: grid; place-items: center; background: radial-gradient(circle at 50% 30%, #312e81, #0b1026); color: #fff; text-align: center; }
#carregando img { width: 96px; border-radius: 24px; }
#carregando .barra { width: min(70vw, 320px); height: 14px; border-radius: 99px; background: rgba(255,255,255,.2); overflow: hidden; margin: 16px auto 0; }
#carregando b { display: block; height: 100%; width: 10%; background: var(--amarelo); transition: width .6s; }

/* HUD */
#hud { position: fixed; top: max(10px, env(safe-area-inset-top)); left: 12px; right: 12px; display: flex; gap: 10px; align-items: flex-start; pointer-events: none; }
#missao { pointer-events: auto; background: var(--fundo); border-radius: 18px; padding: 8px 14px; box-shadow: var(--sombra); max-width: min(70vw, 520px); font-size: clamp(14px, 3.6vw, 18px); line-height: 1.25; }
#missao small { display: block; font-size: 11px; font-weight: 700; color: #6366f1; text-transform: uppercase; letter-spacing: .05em; }
#missao .conta { display: inline-block; margin-left: 6px; background: var(--amarelo); border-radius: 99px; padding: 0 8px; font-weight: 700; }
#hud .direita { margin-left: auto; display: flex; gap: 8px; pointer-events: auto; }
#hud-estrelas, #btn-pausa { background: var(--fundo); border: 0; border-radius: 99px; padding: 8px 14px; font: inherit; font-weight: 700; font-size: 17px; box-shadow: var(--sombra); color: var(--tinta); }
#btn-pausa { cursor: pointer; min-width: 48px; }
#bussola { position: fixed; top: calc(max(10px, env(safe-area-inset-top)) + 70px); left: 50%; margin-left: -26px; width: 52px; height: 52px; border-radius: 50%; background: rgba(250,204,21,.95); display: grid; place-items: center; font-size: 28px; box-shadow: var(--sombra); transition: transform .15s; pointer-events: none; }
#dica { position: fixed; bottom: 190px; right: 16px; background: var(--fundo); padding: 6px 12px; border-radius: 99px; font-weight: 700; box-shadow: var(--sombra); opacity: 0; transition: opacity .2s; pointer-events: none; }
#dica.visivel { opacity: 1; }
#aviso { position: fixed; left: 50%; top: 32%; transform: translate(-50%, -10px); background: rgba(30,27,75,.92); color: #fff; padding: 12px 20px; border-radius: 18px; font-weight: 700; font-size: clamp(15px, 4vw, 20px); text-align: center; max-width: 86vw; opacity: 0; transition: .3s; pointer-events: none; }
#aviso.visivel { opacity: 1; transform: translate(-50%, 0); }

/* controles */
#joystick { position: fixed; left: max(22px, env(safe-area-inset-left)); bottom: max(26px, env(safe-area-inset-bottom)); width: 136px; height: 136px; border-radius: 50%; background: rgba(255,255,255,.28); border: 3px solid rgba(255,255,255,.65); box-shadow: inset 0 0 18px rgba(0,0,0,.25); touch-action: none; }
#joy-pino { position: absolute; left: 50%; top: 50%; width: 62px; height: 62px; margin: -31px 0 0 -31px; border-radius: 50%; background: radial-gradient(circle at 35% 30%, #fff, #c7d2fe); box-shadow: 0 6px 16px rgba(0,0,0,.35); }
#acoes { position: fixed; right: max(18px, env(safe-area-inset-right)); bottom: max(24px, env(safe-area-inset-bottom)); display: grid; grid-template-columns: repeat(2, 76px); grid-template-areas: "acao correr" "pular pular"; gap: 12px; }
.acao { width: 76px; height: 76px; border-radius: 50%; border: 4px solid rgba(255,255,255,.85); font-size: 32px; color: #fff; box-shadow: 0 8px 18px rgba(0,0,0,.35); touch-action: none; cursor: pointer; }
.acao[data-id="acao"] { grid-area: acao; } .acao[data-id="correr"] { grid-area: correr; } .acao[data-id="pular"] { grid-area: pular; width: 100%; border-radius: 40px; height: 72px; }
.acao.ativo { transform: scale(.92); filter: brightness(1.15); }
.acao.pulsar { animation: pulsar 1s infinite; }
@keyframes pulsar { 0%,100% { box-shadow: 0 0 0 0 rgba(250,204,21,.9); } 50% { box-shadow: 0 0 0 14px rgba(250,204,21,0); } }

/* janelas */
#janela { position: fixed; inset: 0; display: none; place-items: center; background: rgba(15,23,42,.45); padding: 16px; z-index: 20; }
#janela.aberta { display: grid; }
.caixa { background: #fff; border-radius: 28px; padding: 20px 20px 18px; width: min(560px, 100%); max-height: 92vh; overflow: auto; text-align: center; box-shadow: var(--sombra); animation: entrar .25s ease-out; }
@keyframes entrar { from { transform: scale(.9); opacity: 0; } }
.caixa h2 { margin: 6px 0 10px; font-size: clamp(20px, 5vw, 28px); }
.caixa p { font-size: clamp(16px, 4vw, 19px); margin: 6px 0 14px; color: #334155; }
.emoji-grande { font-size: clamp(64px, 18vw, 96px); line-height: 1.1; }
.quem { font-size: 20px; }
.contexto { background: #eef2ff; border-radius: 16px; padding: 10px 12px; text-align: left; }
.tag { display: inline-block; background: #dbeafe; color: #1d4ed8; font-weight: 700; border-radius: 99px; padding: 2px 10px; font-size: 13px; }
.ingles { font-size: clamp(32px, 9vw, 46px) !important; color: var(--azul); margin: 4px 0 0 !important; }
.traducao { font-size: 22px !important; font-weight: 700; }
.som { font-size: 34px; font-weight: 700; color: #7c3aed; margin: 8px 0; }
.dica { color: #b45309 !important; font-weight: 700; }
.visual { font-size: clamp(30px, 8vw, 44px); letter-spacing: 4px; margin: 6px 0 12px; line-height: 1.3; }
.opcoes { display: grid; gap: 10px; margin-top: 8px; }
.opcoes.grade { grid-template-columns: repeat(auto-fit, minmax(120px, 1fr)); }
.btn { font: inherit; font-weight: 700; font-size: 18px; border: 0; border-radius: 18px; padding: 12px 18px; background: #e0e7ff; color: var(--tinta); cursor: pointer; box-shadow: 0 4px 0 rgba(30,27,75,.18); min-height: 52px; }
.btn:active { transform: translateY(2px); box-shadow: none; }
.btn.amarelo { background: var(--amarelo); } .btn.azul { background: var(--azul); color: #fff; }
.btn.grande { font-size: 24px; padding: 16px 34px; }
.btn.mini { font-size: 15px; min-height: 40px; padding: 8px 14px; }
.btn.opcao { text-align: left; background: #f1f5f9; }
.btn.opcao.centro { text-align: center; font-size: 22px; }
.emoji-op { font-size: 44px; }
.linha { display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; align-items: center; margin: 6px 0; }
.btn small { opacity: .7; margin-left: 6px; }

/* telas */
#telas { position: fixed; inset: 0; display: none; z-index: 15; overflow: auto; padding: 16px; }
#telas.ativa { display: grid; place-items: center; }
#telas.escura { background: radial-gradient(circle at 50% 30%, rgba(49,46,129,.9), rgba(11,16,38,.95)); color: #fff; }
#telas.menu-lado { place-items: center end; background: linear-gradient(90deg, transparent 30%, rgba(11,16,38,.35)); }
@media (max-width: 720px) { #telas.menu-lado { place-items: end center; background: linear-gradient(180deg, transparent 35%, rgba(11,16,38,.45)); } }
.abertura { text-align: center; max-width: 620px; animation: entrar .6s ease-out; }
.logo-np { width: 88px; border-radius: 22px; box-shadow: 0 10px 30px rgba(0,0,0,.4); }
.apresenta { opacity: .8; font-weight: 700; margin-top: 8px; letter-spacing: .1em; text-transform: uppercase; font-size: 13px; }
.titulo-jogo { font-size: clamp(34px, 9vw, 64px); margin: 6px 0; line-height: 1; background: linear-gradient(90deg, #fde047, #f472b6, #60a5fa); -webkit-background-clip: text; background-clip: text; color: transparent; text-shadow: 0 6px 30px rgba(0,0,0,.2); }
.sub { font-size: clamp(16px, 4vw, 20px); opacity: .9; }
.menu, .painel { background: var(--fundo); border-radius: 28px; padding: 18px; width: min(460px, 100%); box-shadow: var(--sombra); text-align: center; }
.painel { width: min(760px, 100%); }
.painel.lado { width: min(480px, 100%); text-align: left; max-height: 94vh; overflow: auto; }
.menu .titulo-jogo { font-size: clamp(30px, 7vw, 44px); background: linear-gradient(90deg, #7c3aed, #ec4899, #2563eb); -webkit-background-clip: text; background-clip: text; }
.marca { display: flex; align-items: center; justify-content: center; gap: 8px; font-weight: 700; color: #6366f1; }
.marca img { width: 28px; border-radius: 8px; }
.pilha { display: grid; gap: 10px; margin: 12px 0; }
.progresso { font-weight: 700; color: #475569; }
.mundos { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 12px; margin: 14px 0; }
.mundo { font: inherit; border: 0; border-radius: 22px; padding: 16px 10px; background: linear-gradient(160deg, var(--c), color-mix(in srgb, var(--c) 55%, #1e1b4b)); color: #fff; cursor: pointer; display: grid; gap: 4px; justify-items: center; box-shadow: 0 6px 0 rgba(30,27,75,.25); }
.mundo .emoji { font-size: 44px; } .mundo b { font-size: 18px; } .mundo small { opacity: .9; }
.mundo.trancado { filter: grayscale(.8) brightness(.8); cursor: not-allowed; }
.grade-mini { display: flex; flex-wrap: wrap; gap: 8px; margin: 8px 0 12px; }
.mini-card { font: inherit; border: 3px solid transparent; background: #f1f5f9; border-radius: 16px; padding: 6px 10px; font-size: 28px; display: grid; justify-items: center; cursor: pointer; }
.mini-card small { font-size: 12px; font-weight: 700; }
.mini-card.sel, .chip.sel, .cor.sel { border-color: var(--azul); }
.cores .cor { width: 34px; height: 34px; border-radius: 50%; border: 3px solid #fff; box-shadow: 0 0 0 1px #cbd5e1; cursor: pointer; }
.cores .cor.sel { box-shadow: 0 0 0 3px var(--azul); }
.chip { font: inherit; font-size: 14px; font-weight: 700; border: 2px solid #e2e8f0; background: #fff; border-radius: 99px; padding: 5px 10px; cursor: pointer; display: inline-flex; align-items: center; gap: 6px; }
.chip i { width: 14px; height: 14px; border-radius: 50%; display: inline-block; border: 1px solid #cbd5e1; }
.slot { margin-top: 8px; } .slot small, .painel.lado > small { font-weight: 700; color: #6366f1; }
.nota { color: #64748b; font-size: 14px; }
.medalhas { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 10px; margin: 12px 0; }
.medalha { background: #fef9c3; border-radius: 18px; padding: 12px; display: grid; justify-items: center; gap: 4px; }
.medalha span { font-size: 40px; } .medalha small { color: #475569; }
.medalha.apagada { background: #f1f5f9; opacity: .7; }
.palavras { display: grid; grid-template-columns: repeat(auto-fit, minmax(120px, 1fr)); gap: 8px; margin: 10px 0; }
.palavra { font: inherit; border: 0; background: #eff6ff; border-radius: 16px; padding: 10px; display: grid; justify-items: center; cursor: pointer; }
.palavra span { font-size: 34px; } .palavra b { color: var(--azul); font-size: 18px; }
.pais { text-align: left; font-size: 16px; line-height: 1.5; padding-left: 0; list-style: none; }
.pais li { margin: 8px 0; }
label { font-weight: 700; display: inline-flex; gap: 6px; align-items: center; }
input[type=checkbox] { width: 22px; height: 22px; }
@media (max-height: 520px) { #joystick { width: 116px; height: 116px; bottom: 14px; } #acoes { grid-template-columns: repeat(2, 64px); bottom: 12px; } .acao { width: 64px; height: 64px; font-size: 26px; } .acao[data-id="pular"] { height: 60px; } #dica { bottom: 160px; } }

/* legenda de teclas (computador) */
#teclas { position: fixed; left: 50%; bottom: 14px; transform: translateX(-50%); background: rgba(30,27,75,.82); color: #fff; padding: 8px 16px; border-radius: 99px; font-size: 15px; white-space: nowrap; pointer-events: none; }
#teclas b { color: #fde047; }
@media (max-width: 900px) { #teclas { display: none; } }
.chip.grande { font-size: 17px; padding: 8px 16px; }
