.board {
  width: 90vw;
  max-width: 450px;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: .4rem;
  background: #080808;
  border-radius: 1rem;
  margin: .6rem auto;
}

.box {
  aspect-ratio: 1 / 1;
  border: solid 1px var(--color);
  background-image: url("lamp-hidden.png");
  background-size: cover;
  border-radius: 1em;
}

.mole {
  background-image: url("lamp.png");
  background-size: cover;
}

section.bg-orange.section-decorated-bottom {
  position: relative;
}

.hud {
  display: flex;
  justify-content: space-between;
  align-items: center;
  width: 90vw;
  max-width: 450px;
  margin: 0 auto 1rem auto;
  gap: .5em;
}

.hud h2 {
  flex: 1;
  margin: 0;
  font-size: clamp(1rem, 2.5vw, 1.5rem);
}

h2.boxed {
  width: auto !important;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: .5rem 1rem;
  border-radius: 2em;
}

/* Escurece/embaça o jogo */
.game-area.blurred {
  filter: brightness(0.5);
  pointer-events: none;
}

/* Overlay */
.game-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 9500;
  pointer-events: none;
}

.overlay-content {
  pointer-events: auto;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  align-items: center;
}


.alarm {
  position: fixed;              /* ocupa referência da tela inteira */
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  z-index: 9999;                /* garante que fique acima do overlay */
  pointer-events: none;
  animation: shake 0.3s infinite;
}

.alarm img {
  width: 120px;                 /* ajuste conforme tamanho da imagem alarm.webp */
  height: auto;
}

.overlay-buttons {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  align-items: center;
}

.hidden {
  display: none !important;
}

/* garante referência para posicionamento absoluto interno */
.game-area { position: relative; }

/* Alarme posicionado/centralizado apenas sobre o TABULEIRO */
.alarm-overlay {
  position: absolute;
  inset: 0;                    /* ocupa toda a área do .game-area */
  display: none;               /* começa escondido */
  align-items: center;
  justify-content: center;
  z-index: 9;                  /* abaixo do seu overlay final de pontuação */
  pointer-events: none;        /* não bloqueia cliques em nada */
}

/* quando for mostrar, vira um flex centralizado */
.alarm-overlay.show { display: flex; }

/* tamanho + animação do relógio */
.alarm-overlay img {
  width: min(60%, 340px);
  max-width: 420px;
  filter: drop-shadow(0 10px 24px rgba(0,0,0,.35));
  animation: alarm-ring 2s ease-in-out both;
}

/* “tocando” + tremor suave */
@keyframes alarm-ring {
  0%   { transform: scale(.9) rotate(0deg);    }
  10%  { transform: scale(1)  rotate(6deg);    }
  20%  { transform: scale(1)  rotate(-6deg);   }
  30%  { transform: scale(1)  rotate(5deg);    }
  40%  { transform: scale(1)  rotate(-5deg);   }
  50%  { transform: scale(1)  rotate(4deg);    }
  60%  { transform: scale(1)  rotate(-4deg);   }
  70%  { transform: scale(1)  rotate(3deg);    }
  80%  { transform: scale(1)  rotate(-3deg);   }
  90%  { transform: scale(1)  rotate(2deg);    }
  100% { transform: scale(.98) rotate(0deg);   }
}
