/* Integrações comuns das páginas nativas. As cores e componentes vêm do protótipo. */
.brand-disco { width: 32px; height: 20px; image-rendering: pixelated; flex: 0 0 auto; display: inline-block; line-height: 0; }
.brand-disco canvas { display: block; image-rendering: pixelated; }
.eif-ico { display: inline-flex; align-items: center; justify-content: center; flex: 0 0 auto; line-height: 0; vertical-align: middle; }
.eif-ico canvas { display: block; image-rendering: pixelated; }
.lang-select {
  appearance: auto;
  font: 600 13px/1 var(--display);
  color: var(--bone);
  background: var(--plum);
  border: 2px solid var(--plum-2);
  padding: 7px 8px;
  cursor: pointer;
  box-shadow: 0 3px 0 #0c0511;
  max-width: 132px;
}
.lang-select:hover { border-color: var(--cyan); }
.lang-select option { background: #170a1f; color: #ecd6b8; }
.nav-toggle { display: none; }
.menu [aria-current="page"] { color: var(--toxic); text-decoration: underline; text-underline-offset: 5px; }
.footer-links { display: flex; flex-wrap: wrap; gap: 10px 22px; margin-top: 6px; }
.footer-links a { color: var(--cyan); }
.tab-wrap { overflow-x: auto; max-width: 100%; }
.tab-wrap:focus-visible { outline-offset: -2px; }
.manual-figure { margin: 0; display: grid; gap: 12px; }
.manual-figure img { width: 100%; display: block; border: 3px solid var(--plum-2); box-shadow: 0 6px 0 #0c0511; image-rendering: pixelated; }
.manual-figure .manual-art { width: 100%; aspect-ratio: 4 / 3; display: grid; place-items: center; overflow: hidden; background: #12081a; border: 3px solid var(--plum-2); box-shadow: 0 6px 0 #0c0511; }
.manual-content { --tab-bg: #201028; padding: 20px max(16px, 6vw) 64px; background: #201028; }
.manual-section { display: grid; gap: 18px; padding: 36px 0; border-bottom: 2px solid var(--plum-2); }
.manual-section h2 { font-size: clamp(30px, 3.8vw, 46px); color: var(--toxic); }
.manual-section p { max-width: 76ch; }
.manual-section:nth-child(3n+2) h2 { color: var(--cyan); }
.manual-section:nth-child(3n) h2 { color: var(--amber); }
.manual-section .tabela td:first-child { display: table-cell; }
.manual-section .tabela th, .manual-section .tabela td { vertical-align: top; }
.manual-section code { color: var(--cyan); overflow-wrap: anywhere; }
.canvas-unavailable { padding: 14px; background: var(--void); color: var(--bone); border: 2px solid var(--amber); }
/* Até 1180 px os links recolhem no Menu: com o seletor de idioma, a linha do desktop só cabe
   acima de ~1.130 px (o menu quebrava em duas linhas entre 861 e 1.130). */
@media (max-width: 1180px) {
  .topo { flex-wrap: wrap; gap: 12px; }
  .topo .marca { margin-right: auto; font-size: 20px; }
  .topo .nav-toggle:not([hidden]) { display: inline-flex; }
  .topo .menu { order: 4; display: flex; width: 100%; margin-left: 0; gap: 0; }
  .topo .menu a { padding: 12px 14px 12px 0; line-height: 1.3; }
  .topo .menu .lang-select { margin-left: auto; }
  .topo .menu[data-site-nav-state="closed"] { display: none; }
  .topo .nav-toggle[aria-expanded="true"] { --b: #4d2159; transform: translateY(2px); box-shadow: 0 1px 0 var(--s); }
}
/* Celular: a barra fica numa linha só (marca + Menu); o atalho sai, porque o menu e as abas
   levam aos mesmos destinos. Aberto, o menu vira uma folha sobre a página: grade de duas
   colunas com linhas de 48 px, o idioma em linha inteira e um véu que fecha ao toque.
   Sem JavaScript o menu não tem estado e aparece dentro da barra. */
@media (max-width: 640px) {
  .topo { padding-block: 8px; }
  .topo .menu { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); column-gap: 16px; }
  .topo .menu a { display: flex; align-items: center; min-height: 48px; padding: 8px 0; font-size: 16px; border-top: 2px solid var(--plum-2); }
  .topo .menu ~ .btn { display: none; }
  /* 16 px: abaixo disso o iPhone dá zoom ao tocar no seletor */
  .topo .menu .lang-select { grid-column: 1 / -1; width: 100%; max-width: none; min-height: 44px; margin: 10px 0 0; padding: 8px 10px; font-size: 16px; }
  .topo .menu[data-site-nav-state="open"] {
    position: absolute; top: 100%; left: 0; right: 0; z-index: 2;
    max-height: calc(100vh - 140px); max-height: calc(100dvh - 140px); overflow-y: auto; overscroll-behavior: contain;
    padding: 0 max(16px, 3vw) 16px; background: var(--plum);
    border-bottom: 3px solid var(--plum-2); box-shadow: 0 6px 0 #0c0511;
  }
  .topo .menu[data-site-nav-state="open"] a:nth-child(-n+2) { border-top-color: transparent; }
  .topo::after { content: ""; position: absolute; top: 100%; left: 0; right: 0; z-index: 1; height: 100vh; height: 100dvh; background: rgba(8, 3, 12, .62); display: none; }
  .topo:has(.menu[data-site-nav-state="open"]) { z-index: 35; }
  .topo:has(.menu[data-site-nav-state="open"])::after { display: block; }
  html:has(.topo .menu[data-site-nav-state="open"]) { overflow: hidden; }
}
@media (max-width: 420px) {
  .topo .marca { font-size: 18px; gap: 6px; }
  .topo { padding-inline: 12px; gap: 10px; }
  .topo .menu[data-site-nav-state="open"] { padding-inline: 12px; }
}

/* ---------- Modo app: celular em pé ----------
   As cinco páginas ficam numa barra de abas fixa no polegar; a barra de cima sai ao rolar
   para baixo e volta ao rolar para cima (js/site.js). Respeita notch e barra de gestos
   (viewport-fit=cover nas páginas). */
:root { --tabbar-h: 56px; }
.tabbar { display: none; }
/* celular deitado com notch: o conteúdo não passa por baixo do recorte */
body { padding-inline: env(safe-area-inset-left, 0px) env(safe-area-inset-right, 0px); }
@media (max-width: 640px) and (orientation: portrait) {
  body { padding-bottom: calc(var(--tabbar-h) + env(safe-area-inset-bottom, 0px)); }
  .topo { padding-top: calc(8px + env(safe-area-inset-top, 0px)); transition: transform .2s ease; }
  .topo[data-bar="hidden"] { transform: translateY(-100%); }
  .tabbar {
    position: fixed; left: 0; right: 0; bottom: 0; z-index: 30;
    display: grid; grid-template-columns: repeat(5, minmax(0, 1fr));
    padding-bottom: env(safe-area-inset-bottom, 0px);
    background: rgba(23, 10, 31, .94); -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px);
    border-top: 2px solid var(--plum-2);
    -webkit-user-select: none; user-select: none;
  }
  .tabbar a {
    position: relative; display: grid; justify-items: center; align-content: center; gap: 4px;
    min-width: 0; min-height: var(--tabbar-h); padding: 6px 2px 5px;
    color: var(--bone-dim); text-decoration: none; font: 600 11.5px/1.1 var(--body); letter-spacing: .01em;
    -webkit-tap-highlight-color: transparent; -webkit-touch-callout: none;
  }
  .tabbar .eif-ico { width: 24px; height: 24px; }
  .tabbar-rotulo { max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .tabbar a[aria-current="page"] { color: var(--bone); }
  .tabbar a[aria-current="page"]::before { content: ""; position: absolute; top: -2px; left: 24%; right: 24%; height: 3px; background: var(--toxic); }
  .tabbar a:active { background: var(--plum); }
  .tabbar a:focus-visible { outline-offset: -4px; }
  /* teclado aberto: as abas saem, como num app */
  body:has(:is(input:not([type=checkbox], [type=radio], [type=range], [type=button], [type=submit], [type=reset], [readonly]), textarea):focus) .tabbar { display: none; }
}
/* Avisos de sessão também podem aparecer acima da landing. */
.session-status { padding: 9px 14px; border-bottom: 2px solid var(--amber); background: var(--void); color: var(--bone); font-size: 14px; display: flex; align-items: center; flex-wrap: wrap; gap: 8px 14px; }
.session-status p { flex: 1 1 22em; }
.scene-toggle { justify-self: start; margin-bottom: 3px; }

/* O comando de pausa não altera a geometria da câmera do protótipo. */
.camera { position: relative; }
.camera > .scene-toggle { position: absolute; right: 10px; bottom: 34px; z-index: 3; margin: 0; }
/* Câmera estreita, toque ou celular deitado: a legenda pode quebrar em duas linhas, então o
   comando vira um ícone preso ao topo da cena (rótulo 14 + vão 8 + borda 3 + 8 px), sem depender
   dela. O texto continua no botão como nome acessível; aria-pressed troca pausa por play. */
@media (max-width: 640px), (pointer: coarse), (orientation: landscape) and (max-height: 500px) and (max-width: 1099px) {
  .camera > .scene-toggle { --b: rgba(61, 26, 75, .9); top: 33px; right: 8px; bottom: auto; width: 40px; height: 40px; padding: 0; gap: 0; font-size: 0; }
  .camera > .scene-toggle::before { content: ""; width: 12px; height: 14px; background: linear-gradient(90deg, currentColor 0 4px, transparent 4px 8px, currentColor 8px); }
  .camera > .scene-toggle[aria-pressed="true"]::before { width: 0; height: 0; margin-left: 3px; background: none; border-left: 13px solid currentColor; border-block: 8px solid transparent; }
}
.cena > .canvas-unavailable { position: absolute; top: 8px; left: 8px; right: 8px; z-index: 4; margin: 0; font-size: 14px; }
