@font-face {
  font-family: 'Pixelify Sans';
  src: url('../fontes/pixelify-sans-latin.woff2') format('woff2');
  font-weight: 400;
  font-display: swap;
}

:root {
  --mad-esc: #3b2416;
  --mad: #7a4627;
  --mad-cl: #b8773f;
  --papel: #f7e2b3;
  --papel-esc: #e9c98d;
  --texto: #3b2414;
  --realce: #ffe08a;
  --fonte: 'Pixelify Sans', 'Lucida Console', monospace;
}

* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; overflow: hidden; background: #28401f; }
body { font-family: var(--fonte); color: var(--texto); -webkit-font-smoothing: none; }

#jogo {
  position: fixed; inset: 0;
  display: block;
  image-rendering: pixelated;
  cursor: grab;
  touch-action: none;
}
#jogo.arrastando { cursor: grabbing; }

/* caixa de madeira em pixel (bordas em degraus) */
.caixa {
  position: fixed;
  background: var(--papel);
  color: var(--texto);
  border: 3px solid var(--mad-esc);
  box-shadow:
    inset 0 0 0 3px var(--mad-cl),
    inset 0 0 0 6px var(--mad),
    inset 0 -9px 0 0 var(--papel-esc),
    0 5px 0 rgba(20, 10, 6, .35);
  padding: 12px 16px;
  z-index: 2;
}

.titulo { top: 16px; left: 16px; padding: 12px 20px 14px; }
.titulo h1 { margin: 0; font-size: 26px; font-weight: 400; letter-spacing: .5px; line-height: 1.05; color: #5a2e14; text-shadow: 2px 2px 0 #f1cf8f; }
.titulo p { margin: 4px 0 2px; font-size: 14px; color: #7a4a2a; }

.lado-direito { position: fixed; top: 16px; right: 16px; display: flex; flex-direction: column; align-items: flex-end; gap: 12px; z-index: 2; }
.lado-direito .caixa { position: relative; }
.relogio { min-width: 168px; text-align: right; padding: 10px 16px 14px; }
.rel-topo { display: flex; align-items: center; justify-content: flex-end; gap: 8px; font-size: 18px; }
#icone-tempo { width: 24px; height: 24px; image-rendering: pixelated; }
#rel-hora { font-size: 30px; font-weight: 400; line-height: 1.05; color: #5a2e14; }
#rel-local { margin-top: 4px; font-size: 15px; color: #7a4a2a; max-width: 210px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.caixa-mapa { padding: 9px; line-height: 0; }
.caixa-mapa[hidden] { display: none; }
#minimapa { image-rendering: pixelated; cursor: pointer; border: 2px solid var(--mad-esc); }

.controles {
  bottom: 16px; left: 16px;
  display: flex; align-items: center; gap: 8px; flex-wrap: wrap;
  padding: 10px 12px 14px; max-width: 250px;
}
.controles button {
  font: inherit; font-size: 16px; color: #fff4d6; cursor: pointer;
  display: inline-flex; align-items: center; gap: 7px;
  min-height: 36px; padding: 4px 12px 6px;
  background: var(--mad); border: 3px solid var(--mad-esc);
  box-shadow: inset 0 3px 0 var(--mad-cl), inset 0 -3px 0 #5a321b;
  text-shadow: 1px 1px 0 #3b2416;
}
.controles button:hover { background: #8d5430; }
.controles button:disabled { opacity: .45; cursor: default; }
.controles button:active { box-shadow: inset 0 3px 0 #5a321b; transform: translateY(1px); }
.controles button:focus-visible { outline: 3px solid var(--realce); outline-offset: 2px; }
.controles button[aria-pressed="true"] { background: #4f7a3a; box-shadow: inset 0 3px 0 #74a356, inset 0 -3px 0 #355628; }
#bt-mais, #bt-menos { min-width: 38px; justify-content: center; font-size: 20px; }
.sep { width: 3px; height: 28px; background: var(--mad-cl); opacity: .6; }
.atalhos { margin: 2px 2px 0; font-size: 13px; line-height: 1.25; color: #7a4a2a; flex-basis: 100%; }
kbd { font: inherit; background: #fff3d1; border: 2px solid #c9995a; padding: 0 4px; }

.ic { width: 14px; height: 14px; display: inline-block; background: currentColor; image-rendering: pixelated; }
.ic-play { clip-path: polygon(15% 0, 100% 50%, 15% 100%); }
#bt-passeio[aria-pressed="true"] .ic-play { clip-path: polygon(10% 0, 40% 0, 40% 100%, 10% 100%, 10% 0, 60% 0, 90% 0, 90% 100%, 60% 100%); }
.ic-placa { clip-path: polygon(0 10%, 100% 10%, 100% 65%, 60% 65%, 60% 100%, 40% 100%, 40% 65%, 0 65%); }
.ic-tudo { background: transparent; box-shadow: inset 0 0 0 3px currentColor; }

/* faixa com o nome do lugar */
.banner {
  position: fixed; top: 22%; left: 50%; transform: translate(-50%, -12px);
  z-index: 3; pointer-events: none; opacity: 0;
  text-align: center; padding: 12px 34px 16px;
  background: #6e3f22; color: #fff1cf;
  border: 3px solid #2e190d;
  box-shadow: inset 0 0 0 3px #a86a3a, inset 0 -8px 0 #5a321b, 0 6px 0 rgba(20, 10, 6, .35);
  text-shadow: 2px 2px 0 #2e190d;
}
.banner strong { display: block; font-size: 30px; letter-spacing: 1px; }
.banner small { display: block; font-size: 15px; color: #f3d39a; min-height: 0; }
.banner small:empty { display: none; }
.banner.mostrar { animation: banner 2.9s ease forwards; }
@keyframes banner {
  0% { opacity: 0; transform: translate(-50%, -12px); }
  12% { opacity: 1; transform: translate(-50%, 0); }
  80% { opacity: 1; transform: translate(-50%, 0); }
  100% { opacity: 0; transform: translate(-50%, -6px); }
}

.dica {
  position: fixed; left: 0; top: 0; z-index: 4; pointer-events: none;
  padding: 4px 10px 6px; font-size: 15px;
  background: #fff3d1; color: var(--texto);
  border: 3px solid var(--mad-esc); box-shadow: 0 3px 0 rgba(20, 10, 6, .3);
  opacity: 0; transition: opacity .12s;
  white-space: nowrap;
}
.dica.mostrar { opacity: 1; }

.carregando {
  position: fixed; inset: 0; display: grid; place-items: center; z-index: 9;
  background: #28401f; color: #f7e2b3; font-size: 22px; transition: opacity .4s;
}
body.pronto .carregando { opacity: 0; pointer-events: none; }

@media (max-width: 760px) {
  .titulo h1 { font-size: 20px; }
  .titulo { padding: 8px 14px 12px; }
  .relogio { min-width: 0; padding: 8px 12px 12px; }
  #rel-hora { font-size: 22px; }
  .caixa-mapa { display: none; }
  .atalhos, .sep { display: none; }
  .controles { flex-wrap: nowrap; gap: 6px; padding: 8px 10px 12px; }
  .controles button span { display: none; }
  .banner strong { font-size: 22px; }
}
@media (prefers-reduced-motion: reduce) {
  .banner.mostrar { animation-duration: .01s; opacity: 1; }
}
.banner strong, .titulo h1, #rel-hora { font-synthesis: none; }
body { font-synthesis: none; }
.txt-pixel { image-rendering: pixelated; display: block; }
.rel-hora-linha { display: flex; justify-content: flex-end; margin: 4px 0 2px; }

/* telas baixas (notebooks): painéis menores para cobrir menos o mapa */
@media (max-height: 720px) {
  .titulo { top: 10px; left: 10px; padding: 8px 14px 11px; }
  .titulo h1 { font-size: 20px; }
  .titulo p { font-size: 12px; }
  .lado-direito { top: 10px; right: 10px; }
  .relogio { min-width: 0; padding: 7px 12px 11px; }
  .controles { bottom: 10px; left: 10px; padding: 8px 10px 11px; gap: 6px; max-width: 220px; }
  .controles button { min-height: 30px; font-size: 14px; padding: 2px 9px 4px; }
  #bt-mais, #bt-menos { min-width: 32px; font-size: 18px; }
  .atalhos { display: none; }
}
