@charset "UTF-8";
/*
  style.css  (v1.1.0, 16/10/2026 — jogo no celular)
  - O canvas continua com 720x600 de lógica; o CSS só o ESCALA para caber na tela (proporção 6:5).
  - Em tela de toque (<html class="toque">, ver js/mobile.js) aparecem os botões:
      · celular EM PÉ  : canvas no topo, faixa de controles embaixo (altura --faixa);
      · celular DEITADO: canvas ocupa a altura toda, ◀ ▶ à esquerda e FOGO à direita, nas laterais.
  - Este CSS é escrito à mão (o style.scss ficou só como lembrete da paleta; não é compilado).
*/

:root {
  --faixa: 0px;            /* altura reservada para os controles abaixo do canvas */
  --proporcao: 1.2;        /* 720 / 600 */
  --folga: 8px;
}

html {
  -webkit-text-size-adjust: 100%;
  overscroll-behavior: none;
}

body {
  margin: 0;
  padding: env(safe-area-inset-top) env(safe-area-inset-right) env(safe-area-inset-bottom) env(safe-area-inset-left);
  background-color: #000;
  display: flex;
  justify-content: center;
  align-items: center;
  min-height: 100vh;
  min-height: 100dvh;
  font-family: Arial, sans-serif;
  box-sizing: border-box;
}

.game-container {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 20px;
  width: 100%;
}

canvas {
  border: 1px solid #adadad;
  display: block;
  border-radius: 20px;
  box-sizing: border-box;
  /* cabe na largura E na altura da janela (menos a faixa de controles), sempre 6:5 */
  width: min(720px, 100vw - 2 * var(--folga), (100vh - var(--faixa) - 2 * var(--folga)) * var(--proporcao));
  width: min(720px, 100vw - 2 * var(--folga), (100dvh - var(--faixa) - 2 * var(--folga)) * var(--proporcao));
  height: auto;
  aspect-ratio: 720 / 600;
  touch-action: none;
  -webkit-tap-highlight-color: transparent;
  user-select: none;
  -webkit-user-select: none;
}

#highscore-table {
  max-width: 720px;
  color: white;
  text-align: center;
}

/* ---------------------------------------------------------------- controles de toque */
#touch-controls {
  display: none;
}

html.toque .game-container {
  gap: 0;
}

html.toque #touch-controls {
  display: grid;
  grid-template-columns: 1fr 1fr;
  grid-template-areas:
    "topo  topo"
    "mover fogo";
  align-items: center;
  width: 100%;
  max-width: 720px;
  box-sizing: border-box;
  padding: 6px 12px 4px;
  height: var(--faixa);
  gap: 6px 12px;
  user-select: none;
  -webkit-user-select: none;
  -webkit-touch-callout: none;
  -webkit-tap-highlight-color: transparent;
}

html.toque { --faixa: 190px; }

.tc-topo { grid-area: topo; display: flex; gap: 8px; justify-content: center; }
.tc-mover { grid-area: mover; display: flex; gap: 10px; justify-content: flex-start; }
.tc-fogo { grid-area: fogo; display: flex; justify-content: flex-end; }

.tc-btn, .tc-mini {
  font-family: Arial, sans-serif;
  font-weight: bold;
  color: #0F0;
  background: rgba(0, 40, 0, 0.85);
  border: 2px solid #0F0;
  touch-action: none;
  user-select: none;
  -webkit-user-select: none;
  -webkit-tap-highlight-color: transparent;
  cursor: pointer;
  padding: 0;
}

.tc-btn {
  --btn: 84px;
  width: var(--btn);
  height: var(--btn);
  border-radius: 50%;
  font-size: 30px;
  line-height: 1;
}

.tc-btn-fogo {
  width: calc(var(--btn) * 1.5);
  height: calc(var(--btn) * 1.5);
  font-size: 22px;
  letter-spacing: 1px;
  color: #fff;
  background: rgba(120, 0, 0, 0.85);
  border-color: #F55;
}

.tc-mini {
  min-height: 44px;
  min-width: 44px;
  padding: 0 14px;
  font-size: 14px;
  border-radius: 22px;
  color: #cfc;
  border-color: rgba(0, 255, 0, 0.5);
  background: rgba(0, 30, 0, 0.8);
}

.tc-btn.ativo { background: #0A0; color: #000; }
.tc-btn-fogo.ativo { background: #E33; }
.tc-mini.mudo { color: #F88; border-color: #F55; text-decoration: line-through; }

/* celular EM PÉ muito estreito (320 px): botões menores para caber ◀ ▶ + FOGO lado a lado */
@media (max-width: 359px) {
  .tc-btn { --btn: 68px; }
  .tc-mini { padding: 0 10px; font-size: 13px; }
}

/* celular DEITADO: o canvas ocupa a altura toda; os controles ficam nas laterais */
@media (orientation: landscape) and (max-height: 520px) {
  html.toque { --faixa: 0px; --folga: 4px; }
  html.toque body { align-items: center; }
  html.toque #touch-controls {
    position: fixed;
    inset: 0;
    width: auto;
    max-width: none;
    height: auto;
    padding: env(safe-area-inset-top) env(safe-area-inset-right) env(safe-area-inset-bottom) env(safe-area-inset-left);
    pointer-events: none;     /* só os botões recebem o dedo; o meio é do canvas */
    display: block;
  }
  html.toque #touch-controls > div { position: fixed; pointer-events: none; }
  html.toque #touch-controls button { pointer-events: auto; }

  /* largura livre de cada lado do canvas 6:5 */
  html.toque #touch-controls {
    --lado: calc((100vw - 100vh * var(--proporcao)) / 2);
  }
  .tc-btn { --btn: clamp(48px, calc((100vw - 120vh) / 4 - 8px), 84px); font-size: 24px; }
  .tc-btn-fogo { width: calc(var(--btn) * 1.7); height: calc(var(--btn) * 1.7); font-size: 18px; }

  html.toque .tc-mover { left: 8px; bottom: 12px; flex-direction: row; gap: 8px; }
  html.toque .tc-fogo { right: 8px; bottom: 12px; }
  html.toque .tc-topo { top: 6px; right: 8px; flex-direction: column; align-items: flex-end; gap: 6px; }
  .tc-mini { min-height: 44px; padding: 0 10px; font-size: 12px; }
}

/* ---------------------------------------------------------------- painel de recordes (fim de partida) */
/* Desktop: o painel é posicionado pelo próprio game.js (updateFinalReport), como sempre foi. */
.placar-caixa {
  font-family: sans-serif;
  color: #0F0;
  display: flex;
  flex-direction: row;
  justify-content: space-between;
  width: 90%;
  max-width: 720px;
  margin: 20px auto;
  background: rgba(0, 0, 0, 0.7);
  padding: 20px;
  border-radius: 10px;
  box-sizing: border-box;
}

.placar-caixa .placar-col { flex: 1; padding: 10px; text-align: center; min-width: 0; }
.placar-caixa h3 { margin: 0 0 10px; }
.placar-caixa table { width: 100%; border-collapse: collapse; font-size: 14px; }
.placar-caixa th { border-bottom: 1px solid #0F0; padding: 6px 0; }
.placar-caixa td { padding: 6px 0; }
.placar-caixa td.centro { text-align: center; }
.placar-caixa td.total-rotulo { text-align: right; border-top: 1px solid #0F0; }
.placar-caixa td.total { border-top: 1px solid #0F0; }

.placar-jogar { display: none; }

/* Toque: o painel vira uma camada rolável (posição/tamanho dados por posicionarPlacar() em mobile.js) */
#highscore-table.placar-toque {
  position: fixed !important;
  transform: none !important;
  left: 0;
  max-width: none;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  background: #000;
  box-sizing: border-box;
  touch-action: pan-y;
  z-index: 200 !important;
}

#highscore-table.placar-toque:empty { display: none; }

html.toque .placar-caixa {
  width: 100%;
  max-width: none;
  margin: 0;
  padding: 8px;
  border-radius: 0;
  background: transparent;
  flex-direction: column;
}

html.toque .placar-caixa .placar-col { padding: 4px 8px; }
html.toque .placar-caixa table { font-size: 13px; }
html.toque .placar-caixa h3 { font-size: 15px; margin-bottom: 4px; }

html.toque .placar-jogar {
  display: block;
  box-sizing: border-box;
  width: calc(100% - 16px);
  margin: 4px 8px 12px;
  min-height: 52px;
  font-size: 18px;
  font-weight: bold;
  color: #000;
  background: #0F0;
  border: 0;
  border-radius: 26px;
  touch-action: manipulation;
}

@media (orientation: landscape) and (max-height: 520px) {
  html.toque .placar-caixa { flex-direction: row; }
  html.toque .placar-caixa table { font-size: 11px; }
  html.toque .placar-caixa th, html.toque .placar-caixa td { padding: 2px 0 !important; }
}

@media (prefers-reduced-motion: reduce) {
  .tc-btn, .tc-mini { transition: none; }
}

/* ---------------------------------------------------------------- menu (VÍDEO · PÔSTER · MANUAL) e vídeo de demonstração (v1.2.0) */
[hidden] { display: none !important; }

.canvas-wrap { position: relative; display: block; width: fit-content; line-height: 0; }

#menu-links {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 8.5%;
  display: flex;
  justify-content: center;
  gap: 10px;
  line-height: 1;
  padding: 0 8px;
}

.menu-btn {
  font-family: Arial, sans-serif;
  font-size: 14px;
  font-weight: bold;
  letter-spacing: 1px;
  color: #cfc;
  background: rgba(0, 30, 0, 0.85);
  border: 2px solid rgba(0, 255, 0, 0.55);
  border-radius: 22px;
  min-height: 44px;
  min-width: 44px;
  padding: 0 18px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
  cursor: pointer;
  box-sizing: border-box;
  -webkit-tap-highlight-color: transparent;
}
.menu-btn:hover, .menu-btn:focus-visible { background: #0A0; color: #000; outline: none; }

#demo {
  position: fixed;
  inset: 0;
  z-index: 300;
  background: #000;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}
#demo video { max-width: 100%; max-height: 100%; object-fit: contain; display: block; }
#demo-dica {
  position: absolute;
  left: 0; right: 0;
  bottom: calc(14px + env(safe-area-inset-bottom));
  margin: 0;
  text-align: center;
  font: bold 15px Arial, sans-serif;
  color: #0F0;
  text-shadow: 0 0 6px #000, 0 0 3px #000;
  pointer-events: none;
}
