/* =========================================================
   COMPONENTES: botões, controles, cabeçalho, modal
   ========================================================= */

/* ---------- Botões ---------- */
.btn {
  position: relative;
  display: inline-flex; align-items: center; justify-content: center; gap: 0.5em;
  padding: 0.55em 1.6em 0.45em;
  border-radius: 0.9rem;
  font-family: var(--fonte-display);
  font-size: 1.9rem;
  letter-spacing: 0.06em;
  line-height: 1;
  white-space: nowrap;
  transition: transform 0.15s ease, box-shadow 0.2s ease, filter 0.2s ease, background 0.2s ease, opacity 0.2s;
}
.btn:hover:not(:disabled) { transform: translateY(-3px) scale(1.04); }
.btn:active:not(:disabled) { transform: translateY(1px) scale(0.97); }
.btn:disabled { cursor: not-allowed; opacity: 0.45; filter: grayscale(0.6); }

.btn-ouro {
  color: #1a1300;
  background: linear-gradient(180deg, var(--ouro-claro) 0%, var(--ouro) 45%, #E0A800 100%);
  box-shadow: 0 0.35rem 0 var(--ouro-escuro), 0 0.8rem 1.6rem rgba(245, 197, 24, 0.35);
}
.btn-ouro:hover:not(:disabled) { filter: brightness(1.08); box-shadow: 0 0.35rem 0 var(--ouro-escuro), 0 1rem 2.2rem rgba(245, 197, 24, 0.55); }

.btn-vidro {
  color: var(--branco);
  background: rgba(255, 255, 255, 0.1);
  border: 2px solid rgba(255, 255, 255, 0.35);
  backdrop-filter: blur(6px);
}
.btn-vidro:hover:not(:disabled) { background: rgba(255, 255, 255, 0.2); border-color: var(--branco); }

.btn-verde {
  color: #00241a;
  background: linear-gradient(180deg, #5af2c8, var(--sucesso));
  box-shadow: 0 0.3rem 0 #04906c;
}

.btn-perigo {
  color: var(--branco);
  background: rgba(230, 57, 70, 0.18);
  border: 2px solid rgba(230, 57, 70, 0.7);
}
.btn-perigo:hover:not(:disabled) { background: var(--erro); }

.btn-peq { font-size: 1.3rem; padding: 0.5em 1.1em 0.4em; }

/* Botão JOGAR: gigante e pulsante */
.btn-gigante {
  font-size: 3.6rem;
  padding: 0.38em 1.6em 0.28em;
  border-radius: 1.4rem;
  animation: pulsar 1.6s ease-in-out infinite;
}
.btn-gigante::after {
  content: ""; position: absolute; inset: -0.3rem; border-radius: 1.6rem;
  border: 0.2rem solid var(--ouro);
  animation: onda 1.6s ease-out infinite;
  pointer-events: none;
}
.btn-gigante:hover:not(:disabled) { animation-play-state: paused; }
@keyframes pulsar { 0%, 100% { transform: scale(1); } 50% { transform: scale(1.06); } }
@keyframes onda { 0% { opacity: 0.9; transform: scale(1); } 100% { opacity: 0; transform: scale(1.25, 1.5); } }

/* ---------- Controles globais (som / tela cheia) ---------- */
#controles {
  position: fixed; top: 1rem; right: 1rem; z-index: 60;
  display: flex; gap: 0.6rem;
}
.btn-icone {
  width: 3rem; height: 3rem; border-radius: 50%;
  display: grid; place-items: center;
  font-family: var(--fonte-emoji); font-size: 1.35rem; line-height: 1;
  background: rgba(0, 0, 0, 0.45);
  border: 2px solid rgba(255, 255, 255, 0.3);
  backdrop-filter: blur(6px);
  transition: transform 0.15s, background 0.2s, border-color 0.2s;
}
.btn-icone:hover { transform: scale(1.1); background: rgba(0, 0, 0, 0.65); border-color: var(--ouro); }
.btn-icone[aria-pressed="true"] { border-color: var(--erro); }
#btn-tela-cheia { font-family: var(--fonte-corpo); font-weight: 900; font-size: 1.5rem; }

/* ---------- Cabeçalho de telas internas ---------- */
.cabecalho {
  width: 100%; max-width: 92rem;
  display: grid; grid-template-columns: 1fr auto 1fr; align-items: center;
  gap: 1rem; /* a 3ª coluna fica vazia: espaço para os controles fixos */
}
.cabecalho > .btn { justify-self: start; }
.cabecalho-titulo { text-align: center; }
.cabecalho-titulo h2 {
  font-family: var(--fonte-display); font-weight: 400;
  font-size: 3.4rem; letter-spacing: 0.05em; line-height: 1;
  color: var(--ouro);
  text-shadow: 0 0.2rem 0 rgba(0, 0, 0, 0.5), 0 0 1.5rem rgba(245, 197, 24, 0.35);
}
.cabecalho-titulo p { font-weight: 600; font-size: 1.05rem; color: var(--texto-suave); letter-spacing: 0.12em; text-transform: uppercase; margin-top: 0.2rem; }

/* ---------- Modal ---------- */
.modal {
  position: fixed; inset: 0; z-index: 80;
  display: grid; place-items: center;
  background: rgba(0, 0, 0, 0.7);
  backdrop-filter: blur(4px);
  animation: aparecer 0.2s ease;
}
.modal-caixa {
  width: min(32rem, 90vw);
  padding: 2rem;
  background: linear-gradient(180deg, #11371f, #082012);
  border: 2px solid var(--erro);
  border-radius: var(--raio);
  box-shadow: var(--sombra);
  animation: subir 0.25s ease;
}
.modal-caixa h3 { font-family: var(--fonte-display); font-weight: 400; font-size: 2.4rem; letter-spacing: 0.04em; color: var(--branco); }
.modal-caixa p { margin: 0.6rem 0 1.2rem; line-height: 1.5; color: var(--texto-suave); }
.modal-caixa input {
  width: 100%; padding: 0.7rem 1rem; font-size: 1.3rem; font-weight: 800; letter-spacing: 0.2em;
  border-radius: 0.7rem; border: 2px solid rgba(255, 255, 255, 0.3);
  background: rgba(0, 0, 0, 0.4);
}
.modal-caixa input:focus-visible { outline: none; border-color: var(--ouro); }
.modal-erro { display: block; min-height: 1.4em; margin-top: 0.4rem; color: #ff8a93; font-weight: 600; font-size: 0.95rem; }
.modal-botoes { display: flex; justify-content: flex-end; gap: 0.8rem; margin-top: 0.8rem; }

@keyframes aparecer { from { opacity: 0; } to { opacity: 1; } }
@keyframes subir { from { opacity: 0; transform: translateY(1.5rem) scale(0.96); } to { opacity: 1; transform: none; } }

/* Utilitários de animação disparados via JS */
.anim-tremer { animation: tremer 0.45s ease; }
@keyframes tremer {
  0%, 100% { transform: translateX(0); }
  20% { transform: translateX(-0.7rem); } 40% { transform: translateX(0.6rem); }
  60% { transform: translateX(-0.4rem); } 80% { transform: translateX(0.25rem); }
}
.anim-bump { animation: bump 0.6s cubic-bezier(.2, 1.6, .4, 1); }
@keyframes bump { 0% { transform: scale(1); } 35% { transform: scale(1.7); } 100% { transform: scale(1); } }
