/* Página do estúdio ButterPop: sala escura, logo de metal em 3D no centro, menu de ícones no canto
   e painéis de vidro. Sem script, a página mostra o logo parado e os painéis um embaixo do outro. */

:root {
  --fundo: #000;
  --texto: #f5f5f7;
  --secundario: rgba(235, 235, 245, 0.62);
  --terciario: rgba(235, 235, 245, 0.32);
  --icone: #d1d1d6;
  --vidro: rgba(28, 28, 30, 0.66);
  --vidro-claro: rgba(255, 255, 255, 0.07);
  --linha: rgba(255, 255, 255, 0.09);
  --raio: 22px;
  --mola: cubic-bezier(0.2, 0.8, 0.2, 1);
  --h: min(44vh, 56vw); /* altura do símbolo; o script ajusta */
  color-scheme: dark;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; background: var(--fundo); }
body {
  margin: 0;
  min-height: 100vh;
  background: var(--fundo);
  color: var(--texto);
  font: 16px/1.55 -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI Variable Text", "Segoe UI", Inter, Roboto, "Helvetica Neue", Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
}
img { max-width: 100%; height: auto; display: block; }
a { color: inherit; }
a:focus-visible { outline: 2px solid var(--texto); outline-offset: 3px; border-radius: 10px; }

.so-leitor {
  position: absolute; width: 1px; height: 1px; overflow: hidden;
  clip: rect(0 0 0 0); clip-path: inset(50%); white-space: nowrap;
}
.pular {
  position: fixed; left: 16px; top: -60px; z-index: 50;
  background: var(--texto); color: #000; padding: 10px 16px; border-radius: 12px;
  font-weight: 600; text-decoration: none; transition: top 0.2s;
}
.pular:focus { top: 16px; }

/* ---------- A sala ---------- */

.sala {
  position: relative;
  height: 100vh;
  height: 100svh;
  overflow: hidden;
  isolation: isolate;
}
.js .sala { position: fixed; inset: 0; height: auto; }

.luz {
  position: absolute; left: 50%; top: -8vh;
  width: max(110vh, 90vw); height: 112vh;
  transform: translateX(-50%);
  /* Facho já desfocado em imagem (ferramentas/gerar_luz.js do projeto ButterPop): filter: blur seria refeito a cada quadro. */
  background: url("/img/luz.png") center / 100% 100% no-repeat;
  pointer-events: none;
}
.poeira { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; }
.chao {
  position: absolute; left: 50%; bottom: 6vh;
  width: max(90vh, 70vw); height: 34vh;
  transform: translateX(-50%);
  background:
    radial-gradient(50% 50% at 50% 50%, rgba(255, 255, 255, 0.085), rgba(255, 255, 255, 0) 70%);
  pointer-events: none;
}
.grao {
  position: absolute; inset: -8%; /* só um pouco maior que a tela: camada grande pesa na placa de vídeo */
  background: url("/img/grao.png");
  opacity: 0.035; /* sem mix-blend-mode: misturar cores na tela inteira a cada quadro pesa */
  pointer-events: none;
  animation: grao 0.9s steps(6) infinite;
}
@keyframes grao {
  0% { transform: translate(0, 0); } 20% { transform: translate(-3%, 2%); } 40% { transform: translate(2%, -4%); }
  60% { transform: translate(-4%, -1%); } 80% { transform: translate(3%, 3%); } 100% { transform: translate(0, 0); }
}
.vinheta {
  position: absolute; inset: 0; pointer-events: none;
  background: radial-gradient(75% 70% at 50% 48%, rgba(0, 0, 0, 0) 45%, rgba(0, 0, 0, 0.78) 100%);
}

.bloco {
  position: absolute; inset: 0;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: calc(var(--h) * 0.12);
  padding-bottom: 2vh;
  transition: transform 0.9s var(--mola), opacity 0.9s var(--mola), filter 0.9s var(--mola);
}
.nome { width: calc(var(--h) * 1.02); aspect-ratio: 581 / 108; position: relative; }
.nome svg { position: absolute; inset: 0; width: 100%; height: 100%; overflow: visible; }
.palco {
  position: relative;
  width: calc(var(--h) * 477 / 539);
  height: var(--h);
  perspective: calc(var(--h) * 3.2);
}
/* Sombra no chão, presa ao logo */
.palco::after {
  content: ""; position: absolute; left: 50%; top: 97%;
  width: 120%; height: 11%;
  transform: translateX(-50%);
  background: radial-gradient(50% 50% at 50% 50%, rgba(0, 0, 0, 0.85), rgba(0, 0, 0, 0) 100%);
  pointer-events: none;
}
.cena { position: absolute; left: 50%; top: 50%; width: 477px; height: 539px; margin: -269.5px 0 0 -238.5px; transform-style: preserve-3d; }
.lema {
  position: relative;
  margin: calc(var(--h) * 0.06) 0 0;
  font-size: clamp(12px, 1.25vw, 14px);
  font-weight: 700;
  letter-spacing: 0.42em;
  text-transform: uppercase;
  color: rgba(235, 235, 245, 0.55);
  padding-left: 0.42em;
}

/* Sem script (ou antes de o 3D ficar pronto): logo plano em cinza metálico. */
.simbolo-estatico, .nome-estatico { width: 100%; height: 100%; opacity: 0.92; }
.js .simbolo-estatico, .js .nome-estatico { display: none; }

/* Peças em 3D (montadas pelo script) */
.peca, .peca > * { position: absolute; left: 0; top: 0; transform-style: preserve-3d; }
.peca svg { width: 477px; height: 539px; overflow: visible; backface-visibility: hidden; }
.parede, .bisel { transform-origin: 0 0; backface-visibility: hidden; outline: 1px solid transparent; /* borda lisa no 3D */ }
.peca .bisel svg { display: block; width: 100%; height: 100%; overflow: visible; }

/* Estados da abertura: tudo começa escondido e o script acende em ordem. */
.js .luz, .js .chao, .js .poeira { opacity: 0; }
.js .lema { opacity: 0; transform: translateY(6px); transition: opacity 1.2s var(--mola), transform 1.2s var(--mola); }
.js.lema-on .lema { opacity: 1; transform: none; }
.js .menu .icone { opacity: 0; transform: translateX(-8px) scale(0.92); filter: blur(6px); }
.js .idioma { opacity: 0; transform: translateX(8px) scale(0.92); filter: blur(6px); }
.js.menu-on .menu .icone, .js.menu-on .idioma { opacity: 1; transform: none; filter: none; }
.js.menu-on .rodape { opacity: 1; }

/* ---------- Menu de ícones (coluna no canto superior esquerdo) ---------- */

.menu {
  position: fixed; z-index: 20;
  left: max(18px, env(safe-area-inset-left));
  top: max(18px, env(safe-area-inset-top));
  display: flex; flex-direction: column; gap: 10px;
}
.icone {
  position: relative;
  width: 46px; height: 46px;
  display: grid; place-items: center;
  border-radius: 50%;
  color: var(--icone);
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.08);
  -webkit-backdrop-filter: blur(18px) saturate(1.6);
  backdrop-filter: blur(18px) saturate(1.6);
  text-decoration: none;
  transition: opacity 0.7s var(--mola), transform 0.7s var(--mola), filter 0.7s var(--mola), background 0.25s, color 0.25s;
}
.menu .icone:nth-child(2) { transition-delay: 0.07s; }
.menu .icone:nth-child(3) { transition-delay: 0.14s; }
.menu .icone:nth-child(4) { transition-delay: 0.21s; }
.menu .icone:nth-child(5) { transition-delay: 0.28s; }
.icone svg { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }
.icone svg circle[r=".6"], .icone svg circle[r=".7"] { fill: currentColor; }
.icone:hover, .icone[aria-current="true"] { background: rgba(255, 255, 255, 0.16); color: #fff; }
.icone:active { transform: scale(0.94); }
.icone span {
  position: absolute; left: calc(100% + 12px); top: 50%;
  transform: translate(-4px, -50%);
  white-space: nowrap;
  font-size: 12px; font-weight: 500; letter-spacing: 0.01em;
  color: var(--texto);
  background: rgba(44, 44, 46, 0.86);
  -webkit-backdrop-filter: blur(16px);
  backdrop-filter: blur(16px);
  border: 1px solid var(--linha);
  padding: 5px 10px; border-radius: 9px;
  opacity: 0; pointer-events: none;
  transition: opacity 0.2s, transform 0.25s var(--mola);
}
.icone:hover span, .icone:focus-visible span { opacity: 1; transform: translate(0, -50%); }
.painel-aberto .icone span { display: none; }

/* Idioma no canto superior direito */
.idioma {
  position: fixed; z-index: 20;
  right: max(18px, env(safe-area-inset-right));
  top: max(18px, env(safe-area-inset-top));
  height: 46px; padding: 0 16px 0 13px;
  display: inline-flex; align-items: center; gap: 8px;
  border-radius: 999px;
  color: var(--icone);
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.08);
  -webkit-backdrop-filter: blur(18px) saturate(1.6);
  backdrop-filter: blur(18px) saturate(1.6);
  text-decoration: none;
  font-size: 14px; font-weight: 600; letter-spacing: 0.06em;
  transition: opacity 0.7s var(--mola) 0.32s, transform 0.7s var(--mola) 0.32s, filter 0.7s var(--mola) 0.32s, background 0.25s, color 0.25s;
}
.idioma svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }
.idioma:hover { background: rgba(255, 255, 255, 0.16); color: #fff; }
@media (hover: none) { .icone span { display: none; } }

/* ---------- Painéis ---------- */

main { position: relative; z-index: 10; }
.painel {
  max-width: 560px;
  margin: 24px auto;
  padding: 26px 26px 24px;
  background: var(--vidro);
  border: 1px solid var(--linha);
  border-radius: var(--raio);
  -webkit-backdrop-filter: blur(22px) saturate(1.4);
  backdrop-filter: blur(22px) saturate(1.4);
  box-shadow: 0 30px 80px rgba(0, 0, 0, 0.55);
}
.js .painel {
  position: fixed;
  left: calc(max(18px, env(safe-area-inset-left)) + 60px);
  top: max(18px, env(safe-area-inset-top));
  width: min(540px, calc(100vw - 96px));
  max-height: calc(100vh - 36px);
  max-height: calc(100svh - 36px);
  margin: 0;
  overflow-y: auto;
  overscroll-behavior: contain;
  scrollbar-width: thin;
  scrollbar-color: rgba(255, 255, 255, 0.2) transparent;
  visibility: hidden;
  opacity: 0;
  transform: translateX(-18px) scale(0.97);
  transform-origin: top left;
  transition: opacity 0.45s var(--mola), transform 0.55s var(--mola), visibility 0s linear 0.55s;
}
.js .painel.aberto {
  visibility: visible; opacity: 1; transform: none;
  transition: opacity 0.45s var(--mola), transform 0.55s var(--mola), visibility 0s;
}
.js .painel > * { opacity: 0; transform: translateY(8px); transition: opacity 0.5s var(--mola), transform 0.6s var(--mola); }
.js .painel.aberto > * { opacity: 1; transform: none; }
.js .painel.aberto > :nth-child(2) { transition-delay: 0.04s; }
.js .painel.aberto > :nth-child(3) { transition-delay: 0.08s; }
.js .painel.aberto > :nth-child(4) { transition-delay: 0.12s; }
.js .painel.aberto > :nth-child(5) { transition-delay: 0.16s; }
.js .painel.aberto > :nth-child(n+6) { transition-delay: 0.2s; }

.fechar {
  display: none;
  position: absolute; right: 14px; top: 14px;
  width: 32px; height: 32px; border-radius: 50%;
  place-items: center;
  color: var(--secundario);
  background: rgba(255, 255, 255, 0.08);
}
.js .fechar { display: grid; }
.fechar:hover { color: #fff; background: rgba(255, 255, 255, 0.16); }
.fechar svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; }

.sobretitulo { margin: 0 0 4px; font-size: 13px; font-weight: 600; letter-spacing: 0.08em; text-transform: uppercase; color: var(--terciario); }
.painel h2 { margin: 0 0 14px; font-size: 28px; line-height: 1.15; font-weight: 700; letter-spacing: -0.02em; padding-right: 36px; }
.painel p { margin: 0 0 12px; color: var(--secundario); }
.painel p.suave { font-size: 14px; color: var(--terciario); margin-top: 14px; }

.jogo { margin-top: 6px; }
.capa { width: 100%; border-radius: 16px; border: 1px solid var(--linha); }
.jogo-texto { padding: 2px 2px 16px; }
.selo {
  display: inline-block;
  font-size: 12px; font-weight: 600; letter-spacing: 0.02em;
  color: #000; background: var(--texto);
  padding: 3px 10px; border-radius: 999px;
}
.jogo h3 { margin: 10px 0 2px; font-size: 22px; letter-spacing: -0.01em; }
.genero { font-size: 14px; color: var(--terciario) !important; margin-bottom: 10px !important; }
.acoes { display: flex; flex-wrap: wrap; gap: 10px; margin: 18px 0 14px; }
.botao {
  display: inline-flex; align-items: center; justify-content: center;
  min-height: 44px; padding: 0 20px;
  border-radius: 999px;
  background: var(--texto); color: #000;
  font-weight: 600; text-decoration: none;
  transition: transform 0.2s var(--mola), background 0.2s;
}
.botao:hover { background: #fff; }
.botao:active { transform: scale(0.97); }
.botao.vidro { background: rgba(255, 255, 255, 0.1); color: var(--texto); border: 1px solid var(--linha); }
.botao.vidro:hover { background: rgba(255, 255, 255, 0.18); }
.docs { display: flex; flex-wrap: wrap; gap: 6px 18px; font-size: 13px; margin: 0 !important; }
.docs a { color: var(--terciario); text-decoration: none; }
.docs a:hover { color: var(--texto); }

.lista { list-style: none; margin: 16px 0 0; padding: 0; border-radius: 14px; overflow: hidden; background: var(--vidro-claro); }
.lista li { border-top: 1px solid var(--linha); }
.lista li:first-child { border-top: 0; }
.lista > li:not(:has(a)) { display: flex; justify-content: space-between; gap: 16px; padding: 13px 16px; }
.lista li > span { color: var(--secundario); }
.lista li > strong { font-weight: 500; text-align: right; }
.lista.links a {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 12px 16px; text-decoration: none;
  transition: background 0.2s;
}
.lista.links a::after {
  content: ""; flex: none; width: 8px; height: 8px;
  border-right: 2px solid var(--terciario); border-top: 2px solid var(--terciario);
  transform: rotate(45deg);
}
.lista.links a:hover { background: rgba(255, 255, 255, 0.06); }
.lista.links span { display: flex; flex-direction: column; font-size: 14px; color: var(--secundario); min-width: 0; overflow-wrap: anywhere; }
.lista.links strong { font-size: 16px; font-weight: 500; color: var(--texto); }

.rodape {
  position: relative; z-index: 5;
  text-align: center; padding: 30px 16px 40px;
  font-size: 12px; color: var(--terciario);
}
.js .rodape {
  position: fixed; left: 0; right: 0; bottom: 0;
  padding: 0 16px max(16px, env(safe-area-inset-bottom));
  opacity: 0; transition: opacity 1.2s var(--mola);
  pointer-events: none;
}

/* Painel aberto: o logo recua para a direita e escurece. */
.painel:focus { outline: none; }
.js.painel-aberto .rodape { opacity: 0; }
.painel-aberto .bloco { transform: translateX(min(22vw, 300px)) scale(0.82); opacity: 0.55; }

@media (max-width: 760px) {
  :root { --h: min(40vh, 62vw); }
  .js .painel { top: calc(max(14px, env(safe-area-inset-top)) + 58px); left: calc(max(12px, env(safe-area-inset-left)) + 54px); right: 12px; width: auto; max-height: calc(100svh - 72px); padding: 22px 18px 20px; }
  .menu { left: max(12px, env(safe-area-inset-left)); top: max(14px, env(safe-area-inset-top)); gap: 8px; }
  .icone { width: 44px; height: 44px; }
  .idioma { right: max(12px, env(safe-area-inset-right)); top: max(14px, env(safe-area-inset-top)); height: 44px; }
  .painel-aberto .bloco { transform: scale(0.9); opacity: 0.18; }
  .painel h2 { font-size: 24px; }
}

@media (prefers-reduced-motion: reduce) {
  .grao { animation: none; }
  .bloco, .icone, .idioma, .js .painel, .js .painel > *, .lema, .rodape { transition-duration: 0.01s !important; transition-delay: 0s !important; }
}
