/* Encaixe Molecular em tela grande (carbon/). O jogo é desenhado no canvas; aqui ficam só os
   menus por cima. Tudo em vmin, para crescer junto com a TV ou o projetor. Sempre escuro: é um
   palco de jogo, não uma página de leitura. */

/* As fontes desta pasta (cópias das do app, para a pasta andar sozinha). */
@font-face { font-family: "Exo 2"; font-style: italic; font-weight: 600; font-display: swap; src: url("fontes/exo-2-latin-600-italic.woff2") format("woff2"); }
@font-face { font-family: "Inter"; font-style: normal; font-weight: 400; font-display: swap; src: url("fontes/inter-latin-400-normal.woff2") format("woff2"); }
@font-face { font-family: "Inter"; font-style: normal; font-weight: 500; font-display: swap; src: url("fontes/inter-latin-500-normal.woff2") format("woff2"); }

:root { color-scheme: dark; --verde: #6EE7A8; --ouro: #FFE29A; --texto: #F2F7F4; --texto-2: #B9D2C3; --painel: rgba(8, 18, 13, 0.9); }
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; overflow: hidden; background: #071009; color: var(--texto); font-family: Inter, system-ui, sans-serif; }
body { cursor: default; user-select: none; -webkit-user-select: none; }
#palco { position: fixed; inset: 0; display: block; }
.so-leitor { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

.painel {
  position: fixed; left: 50%; top: 50%; transform: translate(-50%, -50%);
  width: min(92vw, 88vmin); max-height: 94vh; overflow-y: auto;
  padding: 3.2vmin 4vmin; border-radius: 3vmin;
  background: var(--painel); border: 2px solid rgba(110, 231, 168, 0.35);
  box-shadow: 0 0 6vmin rgba(46, 139, 87, 0.35), 0 2vmin 6vmin rgba(0, 0, 0, 0.6);
  text-align: center; backdrop-filter: blur(6px);
}
.painel[hidden] { display: none; }
.painel.largo { width: min(96vw, 150vmin); text-align: left; }
.marca { margin: 0; font: italic 600 2.2vmin "Exo 2", Inter, sans-serif; letter-spacing: 0.3em; color: var(--verde); text-transform: uppercase; }
.titulo { margin: 0.6vmin 0 1vmin; font: italic 600 7vmin "Exo 2", Inter, sans-serif; color: #FFFFFF; text-shadow: 0 0 3vmin rgba(110, 231, 168, 0.55); }
.painel.largo .titulo { font-size: 5vmin; }
.subtitulo { margin: 0 0 2.4vmin; font-size: 2.6vmin; color: var(--texto-2); }

.niveis { display: grid; grid-template-columns: 1fr 1fr; gap: 2vmin; }
.coluna-niveis { display: flex; flex-direction: column; gap: 1.2vmin; }
.niveis-titulo { margin: 0; font-size: 1.9vmin; font-weight: 700; letter-spacing: 0.25em; text-transform: uppercase; color: var(--ouro); text-align: left; }

button { font: inherit; color: inherit; cursor: pointer; }
.nivel, .botao-tv {
  border: 0.35vmin solid rgba(255, 255, 255, 0.18); background: rgba(255, 255, 255, 0.06);
  border-radius: 1.8vmin; transition: transform 0.12s, border-color 0.12s, background 0.12s, box-shadow 0.12s;
  outline: none;
}
.nivel { display: grid; grid-template-columns: 1fr auto; text-align: left; padding: 1.5vmin 2vmin; row-gap: 0.3vmin; }
.nivel strong { font-size: 3vmin; }
.nivel small { grid-column: 1; font-size: 1.9vmin; color: var(--texto-2); }
.recorde-nivel { grid-column: 2; grid-row: 1 / span 2; align-self: center; font-size: 1.8vmin; color: var(--ouro); }
.nivel.ativo { border-color: rgba(255, 226, 154, 0.5); }
.botao-tv { padding: 1.4vmin 3vmin; font-size: 2.5vmin; font-weight: 600; }
.botao-tv.discreto { color: var(--texto-2); }
/* O foco tem de ser visível do sofá: borda dourada, brilho e um leve crescimento. */
.nivel.focado, .botao-tv.focado, .nivel:focus-visible, .botao-tv:focus-visible {
  border-color: var(--ouro); background: rgba(255, 226, 154, 0.16); transform: scale(1.04);
  box-shadow: 0 0 0 0.4vmin rgba(255, 226, 154, 0.35), 0 0 3vmin rgba(255, 226, 154, 0.45);
}
.linha-botoes { display: flex; flex-wrap: wrap; justify-content: center; gap: 1.6vmin; margin-top: 2.6vmin; }
.coluna-botoes { display: flex; flex-direction: column; gap: 1.4vmin; width: min(100%, 50vmin); margin: 2vmin auto 0; }
.descricao-nivel { min-height: 1.4em; margin: 2vmin 0 0; font-size: 2.2vmin; color: var(--texto-2); }
.dica-controle { margin: 2.2vmin 0 0; font-size: 2vmin; color: var(--verde); }

.como-grade { display: grid; grid-template-columns: 1fr 1.2fr; gap: 4vmin; font-size: 2.3vmin; line-height: 1.45; }
.como-grade p { margin: 0 0 1.4vmin; }
.tabela-controles { width: 100%; border-collapse: collapse; font-size: 2.1vmin; }
.tabela-controles th { text-align: left; color: var(--ouro); font-size: 1.7vmin; letter-spacing: 0.12em; text-transform: uppercase; padding: 0 1vmin 1vmin 0; }
.tabela-controles td { padding: 0.9vmin 1vmin 0.9vmin 0; border-top: 1px solid rgba(255, 255, 255, 0.1); }
.nota { color: var(--texto-2); font-size: 2vmin; margin-top: 1.6vmin !important; }
.bt { display: inline-grid; place-items: center; width: 3vmin; height: 3vmin; border-radius: 50%; font-weight: 800; font-size: 1.7vmin; color: #0B1510; vertical-align: middle; }
.bt.a { background: #3DBA4E; } .bt.b { background: #E0473C; } .bt.x { background: #2F7FE0; } .bt.y { background: #F2C230; }

.recorde-novo { margin: 0 0 1vmin; font: italic 700 3.6vmin "Exo 2", Inter, sans-serif; color: var(--ouro); text-shadow: 0 0 2vmin rgba(255, 226, 154, 0.7); }
.recorde-novo[hidden] { display: none; }
.fim-numeros { display: grid; grid-template-columns: repeat(5, 1fr); gap: 1.4vmin; margin: 2vmin 0; }
.fim-numeros dt { grid-row: 1; font-size: 1.7vmin; letter-spacing: 0.1em; text-transform: uppercase; color: var(--texto-2); }
.fim-numeros dd { grid-row: 2; margin: 0; font: italic 700 4.2vmin "Exo 2", Inter, sans-serif; color: #FFFFFF; }
.fim-descobertas { font-size: 2.1vmin; color: var(--texto-2); max-width: 70vmin; margin: 0 auto; }

.aviso { position: fixed; left: 50%; bottom: 3vmin; transform: translateX(-50%); padding: 1.4vmin 2.6vmin; border-radius: 99px; background: rgba(8, 18, 13, 0.92); border: 1px solid rgba(110, 231, 168, 0.4); font-size: 2.1vmin; z-index: 5; }
.aviso[hidden] { display: none; }

/* A abertura: o nome do jogo e o PRESS START */
.abertura { position: fixed; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; padding: 4vmin; }
.abertura[hidden] { display: none; }
.abertura-marca { margin: 0 0 2vmin; font: italic 600 2.4vmin "Exo 2", Inter, sans-serif; letter-spacing: 0.4em; text-transform: uppercase; color: var(--verde); }
.abertura-titulo { margin: 0; display: flex; flex-direction: column; align-items: center; line-height: 0.92; font: italic 600 13vmin "Exo 2", Inter, sans-serif; letter-spacing: 0.02em; }
.abertura-titulo .palavra {
  background: linear-gradient(180deg, #FFFFFF 0%, #FFE29A 45%, #FF9A3C 100%); -webkit-background-clip: text; background-clip: text; color: transparent;
  filter: drop-shadow(0 0 2.4vmin rgba(255, 154, 60, 0.55)) drop-shadow(0 0.6vmin 0 rgba(0, 0, 0, 0.5));
}
.abertura-titulo .segunda { background-image: linear-gradient(180deg, #E8FFF2 0%, #6EE7A8 50%, #1E9E62 100%); filter: drop-shadow(0 0 2.4vmin rgba(110, 231, 168, 0.55)) drop-shadow(0 0.6vmin 0 rgba(0, 0, 0, 0.5)); }
:root:not(.sem-movimento) .abertura-titulo .palavra { animation: entra 0.9s cubic-bezier(0.2, 1.4, 0.4, 1) both; }
:root:not(.sem-movimento) .abertura-titulo .palavra:nth-child(2) { animation-delay: 0.18s; }
:root:not(.sem-movimento) .abertura-titulo .segunda { animation-delay: 0.36s; }
/* CARBON: o grafite, cinza-escuro e metálico */
.abertura-titulo .primeira { font-size: 0.62em; letter-spacing: 0.32em; margin-right: -0.32em; background-image: linear-gradient(180deg, #FFFFFF 0%, #B9C3CC 55%, #6B7783 100%); filter: drop-shadow(0 0 1.6vmin rgba(200, 220, 235, 0.45)) drop-shadow(0 0.5vmin 0 rgba(0, 0, 0, 0.5)); }
@keyframes entra { from { transform: scale(0.3) rotate(-8deg); opacity: 0; } to { transform: none; opacity: 1; } }
.abertura-sub { margin: 2.4vmin 0 6vmin; font: italic 600 3.6vmin "Exo 2", Inter, sans-serif; color: #E2EDE6; letter-spacing: 0.22em; text-transform: uppercase; }
.abertura-start { margin: 0; font: italic 700 4.4vmin "Exo 2", Inter, sans-serif; letter-spacing: 0.35em; color: #FFFFFF; text-shadow: 0 0 2vmin rgba(255, 226, 154, 0.9); }
:root:not(.sem-movimento) .abertura-start { animation: pisca 1.1s steps(2, jump-none) infinite; }
@keyframes pisca { 0% { opacity: 1; } 100% { opacity: 0.15; } }
.abertura-dica { margin: 2vmin 0 0; font-size: 1.9vmin; color: var(--texto-2); }

/* Capa e duelo */
.botao-tv.destaque { border-color: rgba(255, 226, 154, 0.55); background: linear-gradient(180deg, rgba(255, 226, 154, 0.22), rgba(255, 226, 154, 0.08)); color: #FFF4D6; }
.botao-tv.largo { display: block; width: 100%; margin-top: 2vmin; font-size: 2.8vmin; }
.linha-botoes.apertada { margin-top: 0.4vmin; }
.opcao { display: grid; grid-template-columns: 1fr; text-align: left; gap: 0.2vmin; padding: 1.2vmin 2.4vmin; border-left-width: 1.2vmin; }
.opcao.j1 { border-left-color: #4FC3F7; }
.opcao.j2 { border-left-color: #FF8A65; }
.opcao-rotulo { font-size: 1.7vmin; letter-spacing: 0.15em; text-transform: uppercase; color: var(--texto-2); }
.opcao strong { font-size: 2.9vmin; }
.opcao small { font-size: 1.8vmin; color: var(--texto-2); font-weight: 400; }
.opcoes-duelo { width: min(100%, 64vmin); }
.placar-rodada { margin: 0 0 1vmin; font: italic 700 9vmin "Exo 2", Inter, sans-serif; color: var(--ouro); text-shadow: 0 0 3vmin rgba(255, 226, 154, 0.5); }
.subtitulo-como { margin: 2.4vmin 0 1vmin; font: italic 600 3vmin "Exo 2", Inter, sans-serif; color: var(--ouro); }

@media (max-aspect-ratio: 1/1) {
  .como-grade { grid-template-columns: 1fr; }
  .niveis { grid-template-columns: 1fr; }
}

/* A capa tem muita coisa: um pouco mais compacta para caber inteira na TV. */
#tela-capa { padding-top: 2.6vmin; padding-bottom: 2.4vmin; }
#tela-capa .titulo { font-size: 6vmin; margin: 0.2vmin 0 0.6vmin; }
#tela-capa .subtitulo { margin-bottom: 1.6vmin; font-size: 2.3vmin; }
#tela-capa .nivel { padding: 1.1vmin 1.8vmin; }
#tela-capa .nivel strong { font-size: 2.7vmin; }
#tela-capa .descricao-nivel { margin-top: 1.4vmin; font-size: 2vmin; }
#tela-capa .linha-botoes { margin-top: 1.6vmin; gap: 1.2vmin; }
#tela-capa .botao-tv { padding: 1.1vmin 2.4vmin; font-size: 2.3vmin; }
#tela-capa .botao-tv.largo { font-size: 2.6vmin; padding: 1.3vmin 2.4vmin; margin-top: 1.4vmin; }
#tela-capa .dica-controle { margin-top: 1.4vmin; font-size: 1.8vmin; }
#tela-pausa .coluna-botoes { gap: 1vmin; }
#tela-pausa .botao-tv { padding: 1.1vmin 3vmin; }

/* Capa: os dois modos especiais lado a lado */
.linha-modos { display: grid; grid-template-columns: 1fr 1fr; gap: 1.6vmin; margin-top: 1.4vmin; }
.botao-tv.modo { display: grid; gap: 0.2vmin; padding: 1.1vmin 2vmin; text-align: center; }
.botao-tv.modo strong { font-size: 2.6vmin; }
.botao-tv.modo small { font-size: 1.7vmin; font-weight: 400; color: var(--texto-2); }

/* Tela "Botões" */
.lista-botoes { width: min(100%, 70vmin); gap: 0.9vmin; }
.lista-botoes .opcao { padding: 0.9vmin 2.2vmin; border-left-color: rgba(255, 255, 255, 0.25); }
.lista-botoes .opcao strong { font-size: 2.5vmin; }
.lista-botoes .opcao.esperando { border-color: var(--ouro); animation: esperando 0.8s ease-in-out infinite alternate; }
@keyframes esperando { from { background: rgba(255, 226, 154, 0.06); } to { background: rgba(255, 226, 154, 0.26); } }

/* Botão escondido some de verdade (as classes de botão definem display). */
.painel button[hidden] { display: none; }

/* ---------- celular e tablet sem controle (a página põe a classe "toque" no html) ---------- */
.so-toque { display: none; }
:root.toque .so-tv { display: none !important; }
:root.toque .so-toque { display: block; }
#palco { touch-action: none; }
.controles-toque { position: fixed; left: 0; right: 0; bottom: 0; z-index: 4; display: grid; grid-template-columns: auto 1fr; gap: 10px; align-items: end;
  padding: 8px 10px calc(10px + env(safe-area-inset-bottom)); pointer-events: none; }
.controles-toque[hidden] { display: none; }
.controles-toque button { pointer-events: auto; touch-action: manipulation; -webkit-tap-highlight-color: transparent; user-select: none; -webkit-user-select: none;
  min-width: 52px; height: 52px; border-radius: 14px; border: 1px solid rgba(255, 255, 255, 0.18); background: rgba(20, 34, 26, 0.88); color: #FFFFFF;
  font: 700 20px Inter, system-ui, sans-serif; display: inline-flex; flex-direction: column; align-items: center; justify-content: center; line-height: 1; padding: 0 8px; }
.controles-toque button small { font-size: 10px; font-weight: 600; color: #CFE3D6; margin-top: 3px; }
.controles-toque button.apertado { background: rgba(255, 226, 154, 0.3); border-color: #FFE29A; transform: scale(0.95); }
.grupo-mover { display: grid; grid-template-columns: repeat(3, 52px); gap: 6px; }
.grupo-acoes { display: flex; gap: 6px; justify-content: flex-end; flex-wrap: wrap; }
.giros { display: flex; gap: 6px; }
.controles-toque .soltar { background: rgba(255, 154, 60, 0.3); border-color: rgba(255, 154, 60, 0.7); }
.controles-toque .pausa-toque { position: fixed; top: calc(8px + env(safe-area-inset-top)); right: 8px; min-width: 40px; height: 40px; font-size: 14px; }
/* deitado: mover à esquerda, girar e soltar à direita, nas laterais do tabuleiro */
@media (orientation: landscape) {
  .controles-toque { grid-template-columns: 1fr 1fr; padding-left: calc(12px + env(safe-area-inset-left)); padding-right: calc(12px + env(safe-area-inset-right)); }
  .grupo-mover { grid-template-columns: repeat(3, 58px); }
  .controles-toque button { height: 58px; min-width: 58px; }
  .grupo-acoes { flex-direction: column; align-items: flex-end; }
}
/* os menus no celular: letras em pixels, legíveis numa tela pequena */
:root.toque .painel { width: min(94vw, 560px); padding: 18px 16px; border-radius: 18px; }
:root.toque .painel.largo { width: 94vw; }
:root.toque .titulo { font-size: clamp(26px, 8vw, 44px); }
:root.toque .marca, :root.toque .niveis-titulo { font-size: 12px; }
:root.toque .subtitulo, :root.toque .descricao-nivel, :root.toque .dica-controle { font-size: 14px; }
:root.toque .nivel { padding: 10px 12px; }
:root.toque .nivel strong, :root.toque #tela-capa .nivel strong { font-size: 16px; }
:root.toque .nivel small, :root.toque .recorde-nivel { font-size: 12px; }
:root.toque .botao-tv, :root.toque #tela-capa .botao-tv { font-size: 15px; padding: 10px 14px; }
:root.toque .botao-tv.modo strong { font-size: 16px; }
:root.toque .botao-tv.modo small { font-size: 12px; }
:root.toque .linha-modos { grid-template-columns: 1fr; }
:root.toque .como-grade { grid-template-columns: 1fr; font-size: 14px; gap: 10px; }
:root.toque .subtitulo-como { font-size: 18px; }
:root.toque .fim-numeros { grid-template-columns: repeat(3, 1fr) !important; }
:root.toque .fim-numeros dt { font-size: 11px; }
:root.toque .fim-numeros dd { font-size: 24px; }
:root.toque .fim-descobertas, :root.toque .aviso { font-size: 13px; }
:root.toque .recorde-novo { font-size: 20px; }
:root.toque .abertura-dica { font-size: 15px; }
@media (max-width: 420px) { :root.toque .niveis { gap: 8px; } :root.toque .nivel small { display: none; } }

/* logo depois do PRESS START o menu surge devagar e não aceita toques (ver travarMenu no jogo.js) */
:root.menu-travado .painel { pointer-events: none; animation: menu-surge 0.5s ease-out both; }
@keyframes menu-surge { from { opacity: 0; } to { opacity: 1; } }

/* O logotipo em pixel art (logo.svg e press-start.svg, gerados por ferramentas/gerar_logo_carbon.cjs) */
.abertura-logo { display: block; width: min(92vw, 112vmin); height: auto; filter: drop-shadow(0 1.2vmin 0 rgba(0, 0, 0, 0.45)); }
:root:not(.sem-movimento) .abertura-logo { animation: entra 0.9s cubic-bezier(0.2, 1.4, 0.4, 1) both; }
.abertura-start { margin-top: 5vmin; }
.abertura-start img { display: block; height: 6.4vmin; width: auto; margin: 0 auto; }
.titulo-logo { margin: 0 0 1.2vmin; text-shadow: none; }
.titulo-logo img { display: block; height: 17vmin; width: auto; max-width: 100%; margin: 0 auto; }
:root.toque .abertura-start img { height: 30px; }
:root.toque .titulo-logo img { height: auto; width: min(84vw, 440px); }
