html, body { overflow: hidden; }

/* Ocupa exatamente a parte visível da tela (sem passar por baixo das barras do Android) */
#app {
  position: fixed;
  inset: 0;
  display: flex;
  flex-direction: column;
  padding: env(safe-area-inset-top) env(safe-area-inset-right) 0 env(safe-area-inset-left);
}

.bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 16px;
}
.bar.bottom {
  justify-content: center;
  padding-bottom: max(16px, env(safe-area-inset-bottom));
}
.bar.bottom .btn { flex: 1; max-width: 240px; }

.level-label { font-size: 28px; font-weight: 800; white-space: nowrap; }

#stage { flex: 1; position: relative; min-height: 0; }
#board { position: absolute; inset: 0; width: 100%; height: 100%; touch-action: none; }

#confetti {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 30;
}

/* Botão de dica "chamando" depois de muito tempo parado */
@keyframes nudge {
  0%, 100% { transform: rotate(0); }
  20% { transform: rotate(-4deg) scale(1.04); }
  40% { transform: rotate(4deg) scale(1.04); }
  60% { transform: rotate(-2deg); }
}
#btn-hint.nudge { animation: nudge 1.2s ease-in-out 3; border-color: var(--yellow); }


.stars { display: flex; justify-content: center; gap: 8px; margin-bottom: 8px; }
.stars svg { width: 64px; height: 64px; }
.stars svg.on { animation: star-pop 0.4s ease backwards; }
.stars svg:nth-child(2) { animation-delay: 0.15s; width: 76px; height: 76px; margin-top: -10px; }
.stars svg:nth-child(3) { animation-delay: 0.3s; }
@keyframes star-pop { from { transform: scale(0); } 70% { transform: scale(1.2); } }

.help { margin: 0 0 16px; padding-left: 28px; font-size: 21px; }
.help li { margin-bottom: 10px; }
.tip { background: #fff6d6; border-radius: 14px; padding: 12px 14px; }

.levels {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 10px;
  margin-bottom: 8px;
}
.levels button {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 72px;
  padding: 6px 2px;
  border: 2px solid var(--line);
  border-radius: 16px;
  background: var(--bg);
  font-size: 24px;
  cursor: pointer;
}
.levels button.current { border-color: var(--green); background: #e6f4ea; }
.levels .mini { font-size: 14px; letter-spacing: 1px; color: var(--yellow); line-height: 1; margin-top: 4px; }
.levels .mini .off { color: var(--line); }

/* Celulares bem estreitos */
@media (max-width: 380px) {
  .bar { gap: 8px; padding: 10px 10px; }
  .bar .btn { padding: 8px 12px; font-size: 18px; gap: 6px; }
  .bar .btn svg { width: 26px; height: 26px; }
  .level-label { font-size: 23px; }
}
