/* Camada online: esconde o estúdio e mostra só o jogo */
#painel, #hud, #faixaTeste, #ajudaDrone, #ajudaAndar { display: none !important; }

/* ---------- tela de entrada (cara de jogo, só CSS: leve no celular) ---------- */
#entrada { position: fixed; inset: 0; z-index: 100; display: flex; align-items: center; justify-content: center; overflow-y: auto;
  padding: max(16px, env(safe-area-inset-top)) 16px max(16px, env(safe-area-inset-bottom)); color: #f4ecd8; text-align: center;
  background: radial-gradient(ellipse 80% 50% at 50% 22%, rgba(245,197,66,.18), transparent 70%),
              linear-gradient(180deg, rgba(6,14,20,.82), rgba(7,19,13,.94)); }
#entrada .caixa { width: 100%; max-width: 380px; margin: auto; animation: onSubir .5s ease-out both; }
@keyframes onSubir { from { transform: translateY(14px) scale(.98); } }   /* sem sumir: se a animação não rodar, a tela aparece igual */
#entrada .logo { margin-bottom: 18px; }
#entrada .piramide { width: 128px; height: 96px; margin: 0 auto 12px; position: relative; filter: drop-shadow(0 0 18px rgba(245,197,66,.5)); animation: onFlutuar 4s ease-in-out infinite; }
@keyframes onFlutuar { 50% { transform: translateY(-5px); } }
#entrada .piramide i { position: absolute; left: 50%; transform: translateX(-50%); height: 17px; border-radius: 3px;
  background: linear-gradient(180deg, #ffe48a, #f5c542 50%, #b8841c); box-shadow: inset 0 -3px 0 rgba(0,0,0,.25); }
#entrada .piramide i:nth-child(1) { top: 0; width: 26px; } #entrada .piramide i:nth-child(2) { top: 20px; width: 52px; }
#entrada .piramide i:nth-child(3) { top: 40px; width: 78px; } #entrada .piramide i:nth-child(4) { top: 60px; width: 104px; }
#entrada .piramide i:nth-child(5) { top: 80px; width: 130px; }
#entrada h1 { margin: 0; font-size: clamp(30px, 9vw, 40px); font-weight: 900; letter-spacing: .5px; line-height: 1; text-transform: uppercase; color: #ffe9a8;
  text-shadow: 0 3px 0 #9c6c12, 0 6px 0 rgba(0,0,0,.35), 0 0 24px rgba(245,197,66,.35); }
#entrada h1 span { color: #f5c542; }
#entrada .sub { margin: 10px 0 0; font-size: 13px; letter-spacing: 3px; text-transform: uppercase; opacity: .65; }
#entrada .carregando { display: flex; align-items: center; justify-content: center; gap: 10px; opacity: .85; }
#entrada .carregando[hidden] { display: none; }
#entrada .giro { width: 18px; height: 18px; border-radius: 50%; border: 3px solid rgba(245,197,66,.25); border-top-color: #f5c542; animation: onGiro .8s linear infinite; }
@keyframes onGiro { to { transform: rotate(360deg); } }
#entrada form, #entrada .lembrado { display: flex; flex-direction: column; gap: 12px; padding: 18px; border-radius: 20px;
  background: rgba(14,26,20,.78); border: 2px solid rgba(245,197,66,.35); box-shadow: 0 18px 40px -12px rgba(0,0,0,.7), inset 0 1px 0 rgba(255,255,255,.06); }
#entrada form[hidden], #entrada .lembrado[hidden], #entrada .generos[hidden] { display: none; }
#entrada button { width: 100%; margin: 0; font: inherit; cursor: pointer; }
/* abas tipo seletor */
#entrada .abas { display: flex; padding: 4px; gap: 4px; border-radius: 14px; background: rgba(0,0,0,.35); }
#entrada .abas button { flex: 1; padding: 10px 6px; border: 0; border-radius: 10px; background: none; color: #f4ecd8; font-size: 15px; font-weight: 700; opacity: .65; transition: .2s; }
#entrada .abas button.ativa { opacity: 1; background: linear-gradient(180deg, #ffd766, #e0a92a); color: #3a2604; box-shadow: 0 3px 0 #8a6010; }
/* campos com ícone */
#entrada .campo { display: flex; align-items: center; gap: 0; margin: 0; border-radius: 14px; background: rgba(0,0,0,.4); border: 2px solid rgba(255,255,255,.12); transition: border-color .2s; }
#entrada .campo:focus-within { border-color: #f5c542; }
#entrada .campo span { width: 46px; font-size: 20px; flex: none; }
#entrada .campo input { flex: 1; min-width: 0; width: 100%; padding: 14px 14px 14px 0; font-size: 17px; border: 0; background: none; color: #fff; outline: none; }
/* escolher explorador / exploradora */
#entrada .generos { display: flex; gap: 10px; }
#entrada .generos label { flex: 1; margin: 0; display: block; cursor: pointer; }
#entrada .generos input { position: absolute; opacity: 0; pointer-events: none; }
#entrada .generos span { display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 10px 6px; border-radius: 14px; font-size: 30px;
  background: rgba(0,0,0,.35); border: 2px solid rgba(255,255,255,.12); transition: .15s; }
#entrada .generos b { font-size: 13px; font-weight: 700; }
#entrada .generos input:checked + span { border-color: #f5c542; background: rgba(245,197,66,.16); transform: translateY(-2px); box-shadow: 0 4px 0 rgba(184,132,28,.8); }
/* interruptor "lembrar" */
#entrada .lembrar { display: flex; align-items: center; justify-content: center; gap: 10px; margin: 0; font-size: 14px; cursor: pointer; opacity: .9; }
#entrada .lembrar input { position: absolute; opacity: 0; }
#entrada .lembrar i { width: 40px; height: 22px; border-radius: 11px; background: rgba(255,255,255,.2); position: relative; transition: .2s; flex: none; }
#entrada .lembrar i::after { content: ""; position: absolute; top: 3px; left: 3px; width: 16px; height: 16px; border-radius: 50%; background: #fff; transition: .2s; }
#entrada .lembrar input:checked + i { background: #4caf50; }
#entrada .lembrar input:checked + i::after { left: 21px; }
/* botão grande com relevo (aperta de verdade) */
#entrada .bt3d { padding: 16px; border: 0; border-radius: 16px; font-size: 20px; font-weight: 900; letter-spacing: .5px; text-transform: uppercase; color: #fff;
  background: linear-gradient(180deg, #5fd35f, #2e9c35); box-shadow: 0 6px 0 #1d6b22, 0 10px 18px -4px rgba(0,0,0,.5); text-shadow: 0 2px 0 rgba(0,0,0,.25);
  transition: transform .08s, box-shadow .08s; }
#entrada .bt3d:active { transform: translateY(5px); box-shadow: 0 1px 0 #1d6b22, 0 4px 10px -4px rgba(0,0,0,.5); }
#entrada .bt3d:disabled { filter: grayscale(.6) brightness(.8); }
#entrada button.link { padding: 4px; border: 0; background: none; color: #f4ecd8; font-size: 14px; text-decoration: underline; opacity: .75; }
#entrada .erro { margin: 0; padding: 10px; border-radius: 12px; background: rgba(224,80,80,.18); border: 1px solid rgba(224,80,80,.5); color: #ffd0d0; font-size: 14px; }
#entrada .erro[hidden] { display: none; }
#entrada .dica { font-size: 12px; opacity: .6; margin: 0; }
@media (max-height: 640px) { #entrada .piramide { display: none; } #entrada .logo { margin-bottom: 12px; } }
#onChat { position: fixed; left: 12px; bottom: 12px; z-index: 20; width: min(380px, calc(100% - 24px)); display: none; }
body.jogando #onChat { display: block; }
#onChat .linhas { display: flex; flex-direction: column; gap: 3px; margin-bottom: 6px; opacity: 0; transition: opacity .4s; pointer-events: none; }
#onChat.ativo .linhas { opacity: 1; }
#onChat .linhas p { margin: 0; padding: 4px 8px; background: rgba(0,0,0,.5); border-radius: 7px; font-size: 14px; word-wrap: break-word; width: fit-content; max-width: 100%; }
#onChat .linhas p b { color: #F5C542; }
#onChat .linhas p.meu b { color: #9fe0a0; }
#onChat .linhas p.adm { background: linear-gradient(90deg, rgba(120,84,10,.85), rgba(60,40,5,.75)); border: 1px solid #f5c542; color: #fff3c4; font-weight: 600; }
#onChat .linhas p.adm b { color: #ffd23f; }
#onChat .linhas p.aviso { color: #ffc0a0; font-style: italic; }
#onChat form { display: flex; gap: 6px; }
#onChat input { flex: 1; font-size: 16px; padding: 8px 10px; border-radius: 9px; background: rgba(0,0,0,.6); display: none; }
#onChat.digitando input { display: block; }
#onChat .btChat { width: 44px; height: 40px; margin: 0; padding: 0; font-size: 20px; border-radius: 9px; background: rgba(0,0,0,.5); }

/* celular: modo jogo (nada de selecionar texto, menu de segurar o dedo, puxar a página ou zoom) */
html, body { overscroll-behavior: none; -webkit-user-select: none; user-select: none; -webkit-touch-callout: none; -webkit-tap-highlight-color: transparent; }
input { -webkit-user-select: text; user-select: text; }
body.jogando, body.jogando * { touch-action: none; }
body.jogando input, body.jogando #onChat button, body.jogando #onVirar button, body.jogando #onTelaCheia { touch-action: manipulation; }
#tela { touch-action: none; }
#onTelaCheia { position: fixed; z-index: 25; top: calc(10px + env(safe-area-inset-top)); left: 50%; transform: translateX(-50%); width: 40px; height: 36px; margin: 0;
  padding: 0; font-size: 20px; line-height: 1; border-radius: 9px; background: rgba(0,0,0,.45); border: 1px solid rgba(255,255,255,.25); color: #fff; }
#onVirar { position: fixed; inset: 0; z-index: 90; display: none; align-items: center; justify-content: center; padding: 24px; text-align: center;
  background: rgba(7,19,13,.94); color: #f4ecd8; }
#onVirar.mostrar { display: flex; }
#onVirar > div { display: flex; flex-direction: column; align-items: center; gap: 12px; max-width: 300px; }
#onVirar .cel { font-size: 64px; animation: onVirarCel 2s ease-in-out infinite; }
@keyframes onVirarCel { 0%, 20% { transform: rotate(0); } 50%, 80% { transform: rotate(-90deg); } 100% { transform: rotate(0); } }
#onVirar b { font-size: 24px; color: #ffd766; }
#onVirar p { margin: 0; opacity: .85; }
#onVirar .tc { width: 100%; margin: 6px 0 0; padding: 14px; border: 0; border-radius: 14px; font-size: 17px; font-weight: 800; color: #fff;
  background: linear-gradient(180deg, #5fd35f, #2e9c35); box-shadow: 0 5px 0 #1d6b22; }
#onVirar .link { width: auto; margin: 0; border: 0; background: none; color: #f4ecd8; text-decoration: underline; opacity: .75; }
#entrada .soCelular { display: none; }
@media (pointer: coarse) { #entrada .soPC { display: none; } #entrada .soCelular { display: block; } }
#onToque { position: fixed; inset: 0; z-index: 15; pointer-events: none; }
/* como no Roblox: toque em qualquer parte do lado esquerdo e o analógico nasce ali; solto, fica discreto no canto */
#onToque .zona { position: absolute; left: 0; bottom: 0; width: 42%; height: 68%; pointer-events: auto; touch-action: none; }
#onToque .joy { position: fixed; left: calc(26px + env(safe-area-inset-left)); bottom: calc(22px + env(safe-area-inset-bottom)); width: 120px; height: 120px; box-sizing: border-box;
  border-radius: 50%; background: rgba(0,0,0,.18); border: 3px solid rgba(255,255,255,.55); opacity: .5; pointer-events: none; transition: opacity .12s; }
#onToque .joy.solto { bottom: auto; opacity: 1; transition: none; }
#onToque .pino { position: absolute; left: 50%; top: 50%; width: 54px; height: 54px; margin: -27px 0 0 -27px; border-radius: 50%;
  background: rgba(255,255,255,.72); box-shadow: 0 1px 6px rgba(0,0,0,.35); pointer-events: none; }
#onToque .pulo { position: absolute; right: calc(26px + env(safe-area-inset-right)); bottom: calc(24px + env(safe-area-inset-bottom)); width: 84px; height: 84px; margin: 0; padding: 0;
  border-radius: 50%; background: rgba(0,0,0,.34); border: 3px solid rgba(255,255,255,.6); box-shadow: none; pointer-events: auto; touch-action: none; display: flex; align-items: center; justify-content: center; }
#onToque .pulo svg { width: 44px; height: 44px; fill: #fff; }
#onToque .pulo:active { background: rgba(255,255,255,.35); }
/* mensagens à esquerda, logo abaixo do contador; nunca descem até o joystick */
body.toque #onChat { left: calc(12px + env(safe-area-inset-left)); right: auto; top: 46px; bottom: auto; width: min(320px, 46%); display: flex; flex-direction: column-reverse; align-items: flex-start; }
body.toque #onChat.digitando { width: min(420px, calc(100% - 24px)); }
body.toque #onChat .linhas { margin: 6px 0 0; align-items: flex-start; justify-content: flex-end; overflow: hidden; max-height: calc(100vh - 240px); }
body.toque #onChat form { width: 100%; justify-content: flex-start; }

/* disco voador (celular): 🛸 ao lado do pulo; voando, ⬆️⬇️ aparecem em volta dele */
#onVoo { position: fixed; z-index: 16; right: 0; bottom: 0; width: 0; height: 0; }
#onVoo button { position: absolute; width: 54px; height: 54px; margin: 0; padding: 0; border-radius: 50%; font-size: 24px; background: rgba(0,0,0,.34); border: 2px solid rgba(255,255,255,.55); box-shadow: none; touch-action: none; }
#onVoo .liga { right: calc(122px + env(safe-area-inset-right)); bottom: calc(26px + env(safe-area-inset-bottom)); }
#onVoo .sobe { right: calc(40px + env(safe-area-inset-right)); bottom: calc(118px + env(safe-area-inset-bottom)); }
#onVoo .desce { right: calc(106px + env(safe-area-inset-right)); bottom: calc(92px + env(safe-area-inset-bottom)); }
#onVoo .sobe, #onVoo .desce { display: none; }
#onVoo.voando .sobe, #onVoo.voando .desce { display: block; }
#onVoo.voando .liga { background: rgba(245,197,66,.45); }

/* troca de mapa (hotel <-> vila) */
#onFade { position: fixed; inset: 0; z-index: 80; display: flex; align-items: center; justify-content: center; background: #0a0705; color: #ffd766; font: 700 20px Georgia, serif; opacity: 0; pointer-events: none; transition: opacity .3s; }
#onFade.ligado { opacity: 1; }

#onContador { position: fixed; left: 12px; top: 12px; z-index: 20; background: rgba(0,0,0,.5); padding: 6px 10px; border-radius: 8px; font-size: 14px; pointer-events: none; }
#onContador:empty { display: none; }
#onRecado { position: fixed; left: 50%; top: 14px; transform: translateX(-50%); z-index: 20; background: rgba(0,0,0,.7); border: 1px solid rgba(245,197,66,.35);
  padding: 8px 14px; border-radius: 9px; display: none; max-width: calc(100% - 32px); text-align: center; pointer-events: none; }
