/* ==========================================================================
   Lumibricks — sempre escuro, como o app (ui/tema/Cores.kt e Tema.kt): blocos coloridos
   sobre fundo preto. A área do jogo tem cores próprias nos dois temas do site; a lista de
   pontuações usa os tokens de site.css.
   ========================================================================== */

.lumibricks {
  --lb-fundo: #05050a;
  --lb-superficie: #1c1c28;
  --lb-texto: #ececf4;
  --lb-texto-2: #c2c2d2;
  --lb-destaque: #ffd95a;
  --lb-borda: #3a3a52;
  --lb-painel: 96px;
  container-type: inline-size;
  max-width: 560px;
  margin: 0 auto;
}

.lb-area {
  position: relative;
  padding: 12px;
  color: var(--lb-texto);
  background: var(--lb-fundo);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  box-shadow: var(--shadow-sm);
}
.lb-jogo {
  display: flex;
  justify-content: center;
  gap: 10px;
}

/* O tabuleiro recebe os gestos: sem rolar a página nem selecionar texto ao arrastar */
.lb-quadro {
  flex: 0 0 auto;
  box-sizing: content-box;
  width: clamp(150px, min(100cqi - 26px - var(--lb-painel) - 10px - 10px, (100vh - 300px) / 2), 330px);
  width: clamp(150px, min(100cqi - 26px - var(--lb-painel) - 10px - 10px, (100svh - 300px) / 2), 330px);
  aspect-ratio: 1 / 2;
  padding: 3px;
  background: #0a0a12;
  border: 2px solid var(--lb-borda);
  border-radius: 6px;
  touch-action: none;
  user-select: none;
  -webkit-user-select: none;
  -webkit-touch-callout: none;
  cursor: pointer;
}
.lb-quadro:focus-visible {
  outline: 3px solid var(--ring);
  outline-offset: 3px;
}
.lb-quadro canvas {
  display: block;
  width: 100%;
  height: 100%;
}

/* ---------- Painel ao lado ---------- */
.lb-painel {
  flex: 0 0 var(--lb-painel);
  display: flex;
  flex-direction: column;
  gap: 8px;
  min-width: 0;
}
.lb-cartao,
.lb-numeros {
  padding: 8px;
  background: var(--lb-superficie);
  border-radius: 12px;
}
.lb-cartao {
  display: grid;
  justify-items: center;
}
.lb-rotulo {
  font-size: 12px;
  font-weight: 600;
  color: var(--lb-texto-2);
}
.lb-mini {
  display: block;
  width: 100%;
  height: 40px;
  margin-top: 6px;
}
.lb-apagado .lb-mini {
  opacity: 0.35;
}
.lb-numeros {
  display: grid;
  gap: 8px;
  margin: 0;
  padding: 10px;
}
.lb-numeros div {
  min-width: 0;
}
.lb-numeros dt {
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--lb-texto-2);
}
.lb-numeros dd {
  margin: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  font-size: 17px;
  font-weight: 800;
  line-height: 1.3;
  font-variant-numeric: tabular-nums;
}
.lb-numeros .lb-destaque {
  color: var(--lb-destaque);
}

/* ---------- Botões ---------- */
.lb-controles {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
  max-width: 460px;
  margin: 12px auto 0;
}
.lb-botao {
  display: grid;
  place-items: center;
  align-content: center;
  gap: 2px;
  min-height: 56px;
  padding: 4px;
  font-size: 12px;
  font-weight: 700;
  color: #fff;
  background: #262636;
  border: 0;
  border-radius: 16px;
  cursor: pointer;
  touch-action: manipulation;
  user-select: none;
  -webkit-user-select: none;
  -webkit-touch-callout: none;
  transition:
    transform 0.12s ease,
    filter 0.12s ease;
}
.lb-botao svg {
  width: 28px;
  height: 28px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2.4;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.lb-botao svg .cheio {
  fill: currentColor;
  stroke: none;
}
.lb-botao span {
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.lb-botao[data-acao="segurar"] svg {
  width: 22px;
  height: 22px;
}
.lb-mover {
  background: #0066cc;
}
.lb-mover svg {
  width: 34px;
  height: 34px;
}
.lb-suave {
  background: #cc6600;
}
.lb-queda {
  background: #cc1f1f;
}
.lb-pausa {
  background: #3d8f36;
}
.lb-botao.lb-pressionado {
  transform: scale(0.93);
  filter: brightness(1.25);
}
.lb-botao:disabled {
  cursor: default;
  opacity: 0.4;
}

/* ---------- Início, pausa e fim ---------- */
.lb-sobreposicao {
  position: absolute;
  inset: 0;
  z-index: 3;
  display: grid;
  place-items: center;
  padding: 14px;
  overflow: auto;
  background: rgba(0, 0, 0, 0.78);
  border-radius: var(--r-lg);
  animation: lb-aparecer 220ms ease-out;
}
.lb-aviso {
  display: grid;
  gap: 10px;
  width: min(100%, 420px);
  padding: 22px 20px;
  text-align: center;
  background: var(--lb-superficie);
  border-radius: 24px;
  box-shadow: 0 18px 46px rgba(0, 0, 0, 0.6);
}
.lb-aviso p {
  margin: 0;
}
.lb-aviso-titulo {
  font-size: clamp(22px, 6cqi, 28px);
  font-weight: 900;
  letter-spacing: 0.02em;
  text-transform: uppercase;
}
.lb-titulo {
  font-size: clamp(26px, 8cqi, 34px);
  font-weight: 900;
  letter-spacing: 0.08em;
  line-height: 1.1;
}
.lb-titulo span {
  text-shadow: 0 0 14px currentColor;
}
.lb-sub {
  color: var(--lb-texto-2);
}
.lb-como {
  margin-top: 4px !important;
  font-weight: 700;
}
.lb-dicas {
  display: grid;
  gap: 6px;
  margin: 0;
  padding: 0;
  list-style: none;
  font-size: 14px;
  text-align: left;
  color: var(--lb-texto-2);
}
.lb-dicas li {
  position: relative;
  padding-left: 16px;
}
.lb-dicas li::before {
  content: "";
  position: absolute;
  top: 0.6em;
  left: 2px;
  width: 6px;
  height: 6px;
  background: var(--lb-destaque);
  border-radius: 50%;
}
.lb-final {
  font-size: 20px;
  font-weight: 800;
  color: var(--lb-destaque);
}
.lb-recorde-novo {
  justify-self: center;
  padding: 6px 16px;
  font-weight: 800;
  color: #ffd700;
  background: rgba(255, 215, 0, 0.16);
  border-radius: 999px;
}
.lb-botao-principal,
.lb-botao-texto {
  min-height: 52px;
  padding: 12px 20px;
  font-size: 15px;
  font-weight: 800;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  border-radius: 16px;
  cursor: pointer;
}
.lb-botao-principal {
  margin-top: 4px;
  color: #fff;
  background: #0066cc;
  border: 0;
}
.lb-botao-principal:hover {
  background: #0077ee;
}
.lb-botao-texto {
  min-height: 44px;
  color: var(--lb-texto);
  background: transparent;
  border: 1px solid rgba(194, 194, 210, 0.35);
  text-transform: none;
  letter-spacing: 0;
}
.lb-botao-texto:hover {
  background: rgba(255, 255, 255, 0.06);
}
@keyframes lb-aparecer {
  from {
    opacity: 0;
  }
}

/* ---------- Ajuda e pontuações ---------- */
.lb-ajuda {
  margin: 14px 0 0;
  font-size: 13.5px;
  text-align: center;
  color: var(--muted);
}
.lb-recordes {
  margin-top: 18px;
  padding: 16px 18px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r);
}
.lb-recordes-topo {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}
.lb-recordes-titulo {
  margin: 0;
  font-size: 18px;
}
.lb-recordes-topo .button {
  min-height: 40px;
  padding: 8px 16px;
}
.lb-confirmar {
  margin-top: 12px;
  padding: 12px 14px;
  background: var(--surface-2);
  border: 1px solid var(--border-2);
  border-radius: var(--r-sm);
}
.lb-confirmar p {
  margin: 0 0 10px;
  color: var(--text-2);
}
.lb-confirmar-botoes {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}
.lb-lista {
  display: grid;
  gap: 6px;
  margin: 12px 0 0;
  padding: 0;
  list-style: none;
}
.lb-lista li {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 4px 12px;
  padding: 8px 0;
  border-top: 1px solid var(--border);
}
.lb-lista li:first-child {
  border-top: 0;
}
.lb-posicao {
  min-width: 2.2em;
  font-weight: 800;
  color: var(--violet-2);
}
.lb-lista strong {
  font-variant-numeric: tabular-nums;
}
.lb-detalhe {
  margin-left: auto;
  font-size: 13px;
  color: var(--muted);
}
.lb-vazio {
  margin: 12px 0 0;
  color: var(--muted);
}

@media (max-width: 420px) {
  .lumibricks {
    --lb-painel: 84px;
  }
  .lb-area {
    margin-inline: -14px;
    padding: 8px;
    border-radius: var(--r);
  }
  .lb-quadro {
    width: clamp(150px, min(100cqi + 28px - 18px - var(--lb-painel) - 8px - 10px, (100vh - 290px) / 2), 330px);
    width: clamp(150px, min(100cqi + 28px - 18px - var(--lb-painel) - 8px - 10px, (100svh - 290px) / 2), 330px);
  }
  .lb-jogo {
    gap: 8px;
  }
  .lb-controles {
    gap: 6px;
    margin-top: 8px;
  }
  .lb-botao {
    min-height: 52px;
    border-radius: 14px;
  }
  .lb-numeros {
    padding: 8px;
  }
  .lb-numeros dd {
    font-size: 15px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .lb-botao,
  .lb-sobreposicao {
    transition: none;
    animation: none;
  }
}
