@import url('https://fonts.googleapis.com/css2?family=Fredoka:wght@400;700&display=swap');

:root {
  --laranja: #ff8a3d;
  --azul-ceu: #a5d8ff;
  --verde: #2ecc71;
  --vermelho: #ff7675;
  --roxo: #a29bfe;
}

html, body { min-height: 100%; }

body {
  font-family: 'Fredoka', sans-serif;
  background: linear-gradient(180deg, #51B1F5 0%, #CDEBFC 100%);
  margin: 0;
  /* Espaço generoso no fundo para propagandas futuras não cobrirem o placar */
  padding-bottom: 120px; 
  display: flex;
  flex-direction: column;
  align-items: center;
  min-height: 100vh;
  min-height: 100svh;
  overflow-x: hidden;
  overflow-y: auto; 
  position: relative;
  overscroll-behavior: none;
  touch-action: manipulation;
}

/* --- BLOQUEIO DE TELA DEITADA (Ajustado para ignorar PC) --- */
#landscape-lock {
  display: none;
  position: fixed;
  inset: 0;
  background: var(--azul-ceu);
  z-index: 99999;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  color: white;
  padding: 20px;
}

/* Agora só aparece em dispositivos com tela de toque (celulares/tablets) */
@media (pointer: coarse) and (orientation: landscape) and (max-height: 600px) {
  #landscape-lock { display: flex; }
}

.icon-rotate {
  font-size: 4rem;
  animation: rotate-phone 2s ease-in-out infinite;
}
@keyframes rotate-phone {
  0% { transform: rotate(-90deg); }
  50% { transform: rotate(0deg); }
  100% { transform: rotate(-90deg); }
}

/* --- TELAS DE SOBREPOSIÇÃO --- */
.overlay {
  position: fixed;
  top: 0; left: 0; width: 100%; height: 100%;
  z-index: 200;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 20px;
  box-sizing: border-box;
  background: rgba(165, 216, 255, 0.55);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  transition: 0.5s opacity ease;
}

.card-info {
  background: white;
  border: 8px solid var(--laranja);
  border-radius: 40px;
  padding: 30px;
  max-width: 500px;
  box-shadow: 0 15px 30px rgba(0, 0, 0, 0.2);
}

/* --- INTERFACE DO JOGO --- */
.topo {
  width: 100%;
  padding: 10px;
  display: flex;
  justify-content: space-around;
  align-items: center;
  background: rgba(255, 255, 255, 0.9);
  z-index: 10;
  box-sizing: border-box;
}

.progresso-container {
  width: 150px;
  height: 12px;
  background: #eee;
  border-radius: 10px;
  overflow: hidden;
  border: 2px solid white;
}
#barra {
  width: 0%; height: 100%;
  background: var(--verde);
  transition: 0.5s;
}

@keyframes respirar {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-6px); }
}

.painel-jogo {
  background: white;
  border: 8px solid var(--laranja);
  border-radius: 40px;
  width: 90%;
  max-width: 480px;
  margin-top: 15px; 
  padding: 20px;
  text-align: center;
  position: relative;
  z-index: 10;
  box-shadow: 0 15px 30px rgba(0, 0, 0, 0.1);
  animation: respirar 4s ease-in-out infinite;
}

#personagem {
  font-size: clamp(70px, 15vw, 100px);
  margin: 10px 0;
  transition: transform 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}
.pulando { transform: scale(1.3) rotate(10deg); }

.feedback-row {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 10px;
  margin-bottom: 10px;
}

#feedback { font-weight: bold; color: #636e72; min-height: 1.2em; }

/* Trilha & Coleção */
.trilha, .colecao {
  display: flex; justify-content: center; align-items: center;
  user-select: none; pointer-events: none;
}
.trilha { gap: 6px; margin: 6px 0 10px; }
.trilha span {
  width: 14px; height: 14px; border-radius: 999px;
  background: rgba(255,255,255,0.65); border: 2px solid rgba(0,0,0,0.06);
}
.trilha span.on { background: var(--roxo); box-shadow: 0 10px 18px rgba(162,155,254,0.35); }
.trilha span.pop { animation: pop 240ms ease; }
.colecao { gap: 6px; margin: 8px 0 0; min-height: 28px; }
.colecao span { font-size: 22px; animation: pop 240ms ease; }

@keyframes pop {
  0% { transform: scale(1); }
  50% { transform: scale(1.35); }
  100% { transform: scale(1); }
}

/* Efeitos Visuais */
#fx-layer {
  position: fixed; inset: 0; pointer-events: none; z-index: 160; overflow: hidden;
}
.confete {
  position: absolute; width: 10px; height: 14px; border-radius: 3px;
  background: var(--c, #fff); opacity: 0.95;
  animation: confete 900ms cubic-bezier(.2,.7,.2,1) forwards;
  will-change: transform, opacity; /* AVISA O NAVEGADOR PARA OTIMIZAR */
}
@keyframes confete {
  from { transform: translate3d(0, -12px, 0) rotate(0deg); opacity: 1; }
  to { transform: translate3d(var(--dx, 0px), var(--dy, 220px), 0) rotate(540deg); opacity: 0; }
}
.float-score {
  position: absolute; font-weight: 700; font-size: 18px; padding: 8px 12px;
  border-radius: 999px; background: rgba(255,255,255,0.92);
  border: 2px solid rgba(0,0,0,0.06); box-shadow: 0 14px 28px rgba(0,0,0,0.12);
  animation: floatUp 900ms ease forwards; transform: translateZ(0); white-space: nowrap;
  will-change: transform, opacity; /* AVISA O NAVEGADOR PARA OTIMIZAR */
}
@keyframes floatUp {
  from { opacity: 0; transform: translate3d(0, 8px, 0) scale(0.98); }
  15% { opacity: 1; }
  to { opacity: 0; transform: translate3d(0, -42px, 0) scale(1.02); }
}

.btn-ouvir {
  width: 42px; height: 42px; border-radius: 50%; border: 3px solid white;
  cursor: pointer; font-size: 1.1rem; display: inline-flex; align-items: center; justify-content: center;
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.18); background: white;
  user-select: none; -webkit-tap-highlight-color: transparent; touch-action: manipulation;
}

.palavra-container {
  font-size: clamp(30px, 8vw, 50px); font-weight: bold;
  display: flex; justify-content: center; align-items: center; flex-wrap: wrap; gap: 10px; margin: 16px 0;
}

.alvo {
  width: clamp(52px, 16vw, 70px); height: clamp(64px, 18vw, 85px);
  border: 4px dashed #ccc; border-radius: 15px; display: flex; align-items: center; justify-content: center;
  background: #f9f9f9; color: var(--laranja);
}

.opcoes-letras {
  display: flex; justify-content: center; gap: 12px; min-height: 85px; flex-wrap: wrap;
}

.letra-drag {
  width: clamp(54px, 14vw, 65px);
  height: clamp(54px, 14vw, 65px);
  background: var(--laranja);
  color: white;
  font-size: clamp(28px, 7vw, 35px);
  font-weight: bold;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 15px;
  cursor: grab;
  box-shadow: 0 8px 0 #d35400, 0 15px 20px rgba(0,0,0,0.2); 
  user-select: none;
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
  transition: transform 0.1s ease, box-shadow 0.1s ease, background 0.2s ease;
}

.btn-acao {
  background: var(--verde); color: white; border: none; padding: 15px 40px;
  font-size: 1.3rem; border-radius: 50px; cursor: pointer; font-weight: bold;
  box-shadow: 0 8px 0 #27ae60; margin-top: 20px; text-transform: uppercase;
}

/* --- PLACAR INFERIOR --- */
.placar-inferior {
  display: flex; justify-content: space-between; gap: 15px; margin-top: 15px;
  width: 90%; max-width: 480px; z-index: 10;
}
.caixa-destaque {
  background: white; border: 6px solid; border-radius: 25px; padding: 12px;
  flex: 1; text-align: center; box-shadow: 0 10px 20px rgba(0, 0, 0, 0.1);
}
.caixa-seq { border-color: #e17055; }
.caixa-pts { border-color: var(--laranja); }
.caixa-destaque span.titulo { display: block; font-size: 1rem; font-weight: bold; color: #636e72; }
.caixa-destaque span.numero { display: block; font-size: 2.5rem; font-weight: bold; }
.caixa-seq span.numero { color: #e17055; }
.caixa-pts span.numero { color: var(--laranja); }

/* --- CONTROLES INFERIORES --- */
.controles-inferiores {
  position: fixed;
  bottom: 20px;
  right: 20px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  z-index: 1000;
}

.btn-circular {
  width: 55px; height: 55px; border-radius: 50%; border: 3px solid white; cursor: pointer;
  font-size: 1.5rem; display: flex; align-items: center; justify-content: center;
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2); background: white;
}

.btn-som.ativo { background: var(--verde); color: white; }
.btn-fs { background: var(--roxo); color: white; }
.btn-musica.ativo { background: var(--laranja); color: white; }

/* ====================================================== */
/* AJUSTE PARA NOTEBOOKS 1366x768 (Telas Baixas)          */
/* ====================================================== */
@media (max-height: 800px) {
  body { padding-bottom: 90px; }
  .topo { padding: 5px 20px; }
  .painel-jogo { margin-top: 5px; padding: 10px; border-width: 5px; }
  #personagem { font-size: 55px; margin: 2px 0; }
  .palavra-container { margin: 5px 0; font-size: 35px; }
  .alvo { width: 45px; height: 55px; }
  .letra-drag { width: 45px; height: 45px; font-size: 26px; }
  .opcoes-letras { min-height: 60px; }
  .caixa-destaque { padding: 5px; border-width: 4px; }
  .caixa-destaque span.titulo { font-size: 0.9rem; }
  .caixa-destaque span.numero { font-size: 1.8rem; }
  .btn-acao { padding: 8px 25px; margin-top: 5px; font-size: 1.1rem; }
  .trilha { margin: 4px 0 6px; }
  .colecao { margin: 4px 0 0; min-height: 24px; }
}

@media (max-height: 650px) {
  body { padding-bottom: 80px; }
  .painel-jogo { padding: 8px; }
  #personagem { font-size: 45px; }
  .palavra-container { margin: 2px 0; font-size: 30px; gap: 5px; }
  .alvo { width: 40px; height: 50px; }
  .letra-drag { width: 40px; height: 40px; font-size: 22px; }
  .btn-acao { margin-top: 2px; font-size: 1rem; padding: 6px 20px; }
  .placar-inferior { margin-top: 5px; }
  .caixa-destaque span.numero { font-size: 1.5rem; }
}

/* Ajustes Mobile Geral */
@media (max-width: 480px) {
  .controles-inferiores { flex-direction: row; bottom: 15px; right: 15px; }
  .btn-circular { width: 45px; height: 45px; font-size: 1.2rem; }
  .painel-jogo { width: 95%; }
}