/* Sítio Feliz — estilos da página que hospeda o canvas */

@font-face {
  font-family: 'Poppins';
  src: url('../assets/fonts/Poppins-SemiBold.ttf') format('truetype');
  font-weight: 600;
  font-display: swap;
}
@font-face {
  font-family: 'Poppins';
  src: url('../assets/fonts/Poppins-Bold.ttf') format('truetype');
  font-weight: 700;
  font-display: swap;
}
@font-face {
  font-family: 'Nunito';
  src: url('../assets/fonts/Nunito.ttf') format('truetype');
  font-weight: 200 1000;
  font-display: swap;
}

:root {
  --madeira-escura: #2A1F14;
  --madeira: #6E5032;
  --dourado: #B48C3C;
  --amarelo: #FFD764;
  --creme: #F5E6C3;
  --verde: #4CAF50;
  --texto-claro: #FFF5DC;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  height: 100%;
  background: var(--madeira-escura);
  color: var(--texto-claro);
  font-family: 'Nunito', 'Segoe UI', system-ui, sans-serif;
  overflow: hidden;
  overscroll-behavior: none;
  -webkit-tap-highlight-color: transparent;
  user-select: none;
  -webkit-user-select: none;
}

.palco {
  position: fixed;
  inset: 0;
  display: grid;
  place-items: center;
  background:
    radial-gradient(ellipse at center, #3a2b1b 0%, var(--madeira-escura) 70%);
}

#jogo {
  display: block;
  touch-action: none;
  cursor: none;
  box-shadow: 0 0 40px rgba(0, 0, 0, 0.5);
}

/* Tela de carregamento */
.carregando {
  position: fixed;
  inset: 0;
  z-index: 10;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 14px;
  background: radial-gradient(ellipse at center, #4a3520 0%, var(--madeira-escura) 75%);
  transition: opacity 0.5s ease, visibility 0.5s;
}
.carregando.oculto { opacity: 0; visibility: hidden; }
.carregando h1 {
  margin: 0;
  font-family: 'Poppins', sans-serif;
  font-weight: 700;
  font-size: clamp(32px, 6vw, 56px);
  color: var(--amarelo);
  text-shadow: 0 3px 0 #4A2A0E, 0 6px 16px rgba(0, 0, 0, 0.5);
}
.carregando p { margin: 0; opacity: 0.85; font-weight: 700; }
.barra {
  width: min(360px, 80vw);
  height: 16px;
  border-radius: 8px;
  background: rgba(0, 0, 0, 0.4);
  border: 2px solid var(--dourado);
  overflow: hidden;
}
#progresso {
  width: 0;
  height: 100%;
  background: linear-gradient(90deg, #5BAE3C, #8BD34E);
  transition: width 0.2s ease;
}

/* Aviso de orientação em celulares na vertical */
.girar { display: none; }
@media (orientation: portrait) and (max-width: 820px) {
  .girar {
    position: fixed;
    inset: 0;
    z-index: 20;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 16px;
    padding: 24px;
    text-align: center;
    font-size: 20px;
    font-weight: 800;
    background: var(--madeira-escura);
  }
}

@media (prefers-reduced-motion: reduce) {
  .carregando, #progresso { transition: none; }
}
