* { box-sizing: border-box; margin: 0; padding: 0; }

html, body {
  width: 100%;
  height: 100%;
  overflow: hidden;
  background: #0b1030;
  font-family: "Patrick Hand", "Comic Sans MS", cursive;
  color: #fff;
}

#tela {
  display: block;
  width: 100vw;
  height: 100vh;
}

body.ocioso { cursor: none; }

#hud {
  position: fixed;
  inset: 0;
  pointer-events: none;
  text-shadow: 0 1px 3px rgba(0, 0, 0, 0.6);
  transition: opacity 0.6s;
}
#hud.escondido { opacity: 0; }

#topo, #rodape { transition: opacity 0.8s; }
body.ocioso #topo, body.ocioso #rodape { opacity: 0; }

#topo {
  position: absolute;
  top: 14px;
  left: 16px;
}
#topo h1 {
  font-size: 26px;
  font-weight: normal;
  letter-spacing: 0.5px;
}
#dias { font-size: 16px; opacity: 0.85; }
#aviso { display: inline-block; font-size: 13px; margin-top: 4px; padding: 1px 8px; border-radius: 6px; background: rgba(0, 0, 0, 0.35); color: rgba(255, 255, 255, 0.9); }

#historia {
  position: absolute;
  top: 18%;
  left: 0;
  right: 0;
  text-align: center;
  font-size: clamp(22px, 4vw, 38px);
  opacity: 0;
  transform: translateY(8px);
  transition: opacity 1s, transform 1s;
}
#historia::before { content: "~ "; }
#historia::after { content: " ~"; }
#historia.visivel { opacity: 0.9; transform: none; }

#rodape {
  position: absolute;
  bottom: 12px;
  left: 16px;
  right: 16px;
  display: flex;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
}
#relogio { font-size: 20px; }
#botoes { display: flex; gap: 8px; pointer-events: auto; }
#botoes button {
  font: inherit;
  font-size: 16px;
  color: #fff;
  background: rgba(0, 0, 0, 0.35);
  border: 1px solid rgba(255, 255, 255, 0.35);
  border-radius: 8px;
  padding: 4px 12px;
  cursor: pointer;
}
#botoes button:hover { background: rgba(0, 0, 0, 0.55); }
#dicas { margin-left: auto; font-size: 15px; opacity: 0.75; }

#creditos {
  margin: auto;
  max-width: min(560px, calc(100vw - 32px));
  padding: 20px 24px;
  border: none;
  border-radius: 12px;
  background: #fffdf6;
  color: #2d2d2d;
  font-size: 17px;
  line-height: 1.4;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.4);
}
#creditos::backdrop { background: rgba(10, 15, 40, 0.55); }
#creditos h2 { font-weight: normal; font-size: 26px; margin-bottom: 10px; }
#creditos p { margin-bottom: 10px; }
#creditos a { color: #1f6fb5; }
#creditos button {
  font: inherit;
  margin-top: 6px;
  padding: 4px 16px;
  border-radius: 8px;
  border: 1px solid #bbb;
  background: #fff;
  cursor: pointer;
}
body:has(#creditos[open]) { cursor: auto; }

@media (max-width: 640px) {
  #dicas { display: none; }
  #topo h1 { font-size: 20px; }
  #aviso { font-size: 12px; }
}
