/* EniGame — estilo base (paleta tirada da arte do logo) */
:root {
  --bg: #05080c;
  --azul: #4f8fb3;
  --azul-escuro: #1c3a52;
  --vermelho: #e8432c;
  --creme: #efe4cc;
  --cinza: #8a94a0;
  --painel: rgba(5, 8, 12, 0.58);
  --borda: rgba(239, 228, 204, 0.1);
  --fonte-titulo: "Cinzel", "Trajan Pro", Georgia, "Times New Roman", serif;
  --fonte-mono: "IBM Plex Mono", Consolas, "Courier New", monospace;
  color-scheme: dark;
}

* { box-sizing: border-box; }
html, body { height: 100%; margin: 0; }
body {
  background: var(--bg);
  color: var(--creme);
  font-family: var(--fonte-mono);
  font-size: 15px;
  line-height: 1.6;
  overflow-x: hidden;
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 24px 16px;
  opacity: 0;
  transition: opacity 1.4s ease;
}
body.pronto { opacity: 1; }
body.saindo { opacity: 0; transition: opacity 1s ease; }

#fx {
  position: fixed;
  inset: 0;
  width: 100vw;
  height: 100vh;
  display: block;
  z-index: 0;
}

.oculto, #midia-oculta { position: absolute; width: 1px; height: 1px; opacity: 0; overflow: hidden; pointer-events: none; }
#midia-oculta video { width: 1px; height: 1px; }

#painel {
  position: relative;
  z-index: 1;
  width: min(560px, 100%);
  padding: 28px 28px 24px;
  background: var(--painel);
  border: 1px solid var(--borda);
  border-radius: 6px;
  backdrop-filter: blur(14px) saturate(120%);
  -webkit-backdrop-filter: blur(14px) saturate(120%);
  box-shadow: 0 30px 80px rgba(0, 0, 0, 0.55), inset 0 0 0 1px rgba(0, 0, 0, 0.3);
  transform: translateY(12px);
  transition: transform 1.2s cubic-bezier(.2,.7,.2,1);
}
body.pronto #painel { transform: translateY(0); }

.topo {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  margin-bottom: 18px;
  font-size: 12px;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--cinza);
}
.marca { font-family: var(--fonte-titulo); font-size: 15px; letter-spacing: 0.12em; text-transform: none; color: var(--creme); }
.marca b { color: var(--vermelho); font-weight: 700; }
.fase-num { color: var(--azul); }

h1 {
  font-family: var(--fonte-titulo);
  font-weight: 400;
  font-size: 30px;
  letter-spacing: 0.08em;
  margin: 0 0 12px;
  color: var(--creme);
  text-shadow: 0 0 24px rgba(79, 143, 179, 0.35);
}
body.tipo-inicio h1 { font-size: 40px; }
#texto { margin: 0 0 20px; color: #d5ccb8; }
#texto a { color: var(--azul); }

#midia-visivel { margin: 0 0 20px; }
#midia-visivel[hidden] { display: none; }
.midia-img, .midia-video { display: block; width: 100%; height: auto; border-radius: 4px; border: 1px solid var(--borda); }
.midia-audio { width: 100%; filter: invert(0.9) hue-rotate(180deg) saturate(0.6); }

/* dica */
#dica {
  margin: 0 0 18px;
  border: 1px dashed rgba(79, 143, 179, 0.35);
  border-radius: 4px;
  padding: 8px 12px;
  color: #bfc7cf;
}
#dica summary {
  cursor: pointer;
  list-style: none;
  display: flex;
  justify-content: space-between;
  font-size: 12px;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--azul);
  user-select: none;
}
#dica summary::-webkit-details-marker { display: none; }
#dica .dica-estado { color: var(--cinza); letter-spacing: 0.1em; }
#dica.bloqueada summary { color: #4a5660; cursor: not-allowed; }
#dica p { margin: 10px 0 2px; font-style: italic; }
#dica[hidden] { display: none; }

/* resposta */
#form { display: flex; gap: 10px; align-items: stretch; margin: 0; }
#form[hidden] { display: none; }
#resposta {
  flex: 1;
  background: rgba(0, 0, 0, 0.35);
  border: 1px solid rgba(239, 228, 204, 0.18);
  border-bottom-color: var(--azul);
  border-radius: 3px;
  color: var(--creme);
  font: inherit;
  font-size: 17px;
  letter-spacing: 0.06em;
  padding: 10px 14px;
  outline: none;
  transition: border-color .3s, box-shadow .3s;
}
#resposta:focus { border-color: var(--azul); box-shadow: 0 0 0 3px rgba(79, 143, 179, 0.18); }
#resposta::placeholder { color: #4a5660; }
#form button, .btn {
  background: var(--vermelho);
  color: #fff6ea;
  border: 0;
  border-radius: 3px;
  padding: 10px 18px;
  font: inherit;
  font-size: 15px;
  letter-spacing: 0.12em;
  cursor: pointer;
  text-decoration: none;
  display: inline-block;
  transition: filter .2s, transform .2s;
}
#form button:hover, .btn:hover { filter: brightness(1.12); transform: translateY(-1px); }
.btn-sec { background: transparent; border: 1px solid rgba(79, 143, 179, 0.5); color: var(--azul); }
.btn-som { background: transparent; border: 1px solid var(--borda); color: var(--cinza); border-radius: 3px; padding: 6px 12px; font: inherit; font-size: 12px; cursor: pointer; }
#acoes { display: flex; gap: 12px; flex-wrap: wrap; margin-top: 8px; }
#acoes[hidden] { display: none; }

/* bloco "como jogar" da tela inicial */
.como-jogar {
  margin: 0 0 22px;
  padding: 14px 16px 12px;
  border: 1px dashed rgba(79, 143, 179, 0.35);
  border-radius: 4px;
  color: #bfc7cf;
  font-size: 13.5px;
}
.como-jogar h2 {
  margin: 0 0 10px;
  font-size: 12px;
  font-weight: 400;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--azul);
}
.como-jogar ul { margin: 0; padding-left: 18px; }
.como-jogar li { margin: 0 0 6px; }
.como-jogar li::marker { color: var(--vermelho); }
.como-jogar code { color: var(--creme); background: rgba(255,255,255,0.05); padding: 0 4px; border-radius: 2px; }

.msg { min-height: 1.6em; margin: 14px 0 0; font-size: 14px; letter-spacing: 0.04em; }
.msg.errada { color: #9aa3ad; }
.msg.perto { color: #e0a84a; }
.msg.certa { color: var(--azul); text-shadow: 0 0 14px rgba(79, 143, 179, 0.6); }
.nota { margin: 16px 0 0; font-size: 11px; letter-spacing: 0.14em; text-transform: uppercase; color: #4a5660; }

/* fases: visual limpo, sem cabeçalho; o fundo é o protagonista */
body.tipo-fase .topo { display: none; }
body.tipo-fase { align-items: end; padding-bottom: max(28px, 5vh); }
body.tipo-fase #painel {
  width: min(640px, 100%);
  padding: 18px 20px 14px;
  background: rgba(5, 8, 12, 0.42);
  border-color: rgba(239, 228, 204, 0.07);
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.45);
}
body.tipo-fase #dica { margin-bottom: 12px; }
body.tipo-fase .msg { margin-top: 8px; min-height: 0; }
body.tipo-fase .msg:empty { display: none; }
body.tipo-fase .nota { margin-top: 10px; }

@keyframes shake {
  10%, 90% { transform: translateX(-1px); }
  20%, 80% { transform: translateX(2px); }
  30%, 50%, 70% { transform: translateX(-4px); }
  40%, 60% { transform: translateX(4px); }
}
#form.shake { animation: shake .5s cubic-bezier(.36,.07,.19,.97) both; }

@media (max-width: 520px) {
  #painel { padding: 22px 18px 18px; }
  h1 { font-size: 24px; }
  body.tipo-inicio h1 { font-size: 30px; }
}
@media (prefers-reduced-motion: reduce) {
  body, #painel { transition: none; }
  #form.shake { animation: none; }
}
