/* Henri Paixão — o campo
   Mundo escuro, boneco branco, sinal laranja. A UI fica quase toda fora do caminho. */

:root {
  --void: #04050a;
  --grass-tip: #1b2130;
  --bone: #f4f5f0;
  --bone-soft: rgba(244, 245, 240, 0.62);
  --signal: #ff5a24;
  --display: "Barlow Condensed", "Bahnschrift Condensed", "Arial Narrow", sans-serif;
  --body: "Figtree", "Aptos", "Segoe UI", system-ui, sans-serif;
  --pad: clamp(16px, 3vw, 34px);
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  height: 100%;
  background: var(--void);
  color: var(--bone);
  font-family: var(--body);
  overscroll-behavior: none;
}

body { overflow: hidden; }
body.is-list-open { overflow: auto; }

::selection { background: var(--signal); color: var(--void); }

:focus-visible {
  outline: 2px solid var(--signal);
  outline-offset: 3px;
  border-radius: 6px;
}

#scene {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  display: block;
  touch-action: none;
  cursor: grab;
}
#scene:active { cursor: grabbing; }

/* ---------- boot ---------- */

.boot {
  position: fixed;
  inset: 0;
  z-index: 60;
  display: grid;
  place-content: center;
  justify-items: center;
  gap: 14px;
  background: var(--void);
  transition: opacity 0.7s ease, visibility 0.7s ease;
}
.boot.is-done { opacity: 0; visibility: hidden; }
.boot__bar {
  width: 170px;
  height: 2px;
  background: rgba(244, 245, 240, 0.16);
  overflow: hidden;
}
.boot__bar i {
  display: block;
  height: 100%;
  width: 6%;
  background: var(--signal);
  transition: width 0.35s ease;
}
.boot__label {
  font: 700 0.6rem/1 var(--body);
  letter-spacing: 0.24em;
  text-transform: uppercase;
  color: var(--bone-soft);
}

/* ---------- topo ---------- */

.topbar {
  position: fixed;
  z-index: 30;
  top: 0;
  left: 0;
  right: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: var(--pad);
  pointer-events: none;
}
.topbar > * { pointer-events: auto; }

.mark {
  font: 800 1.3rem/1 var(--display);
  letter-spacing: -0.02em;
  color: var(--bone);
  text-shadow: 0 2px 18px rgba(0, 0, 0, 0.8);
}

.ghost-btn {
  font: 700 0.6rem/1 var(--body);
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--bone);
  background: rgba(10, 12, 20, 0.6);
  -webkit-backdrop-filter: blur(8px);
  backdrop-filter: blur(8px);
  border: 1px solid rgba(244, 245, 240, 0.24);
  border-radius: 999px;
  padding: 10px 15px 9px;
  cursor: pointer;
  transition: background 0.2s ease, border-color 0.2s ease, color 0.2s ease;
}
.ghost-btn:hover {
  background: var(--bone);
  color: var(--void);
  border-color: var(--bone);
}

/* ---------- dica de controles ---------- */

.hint {
  position: fixed;
  z-index: 25;
  left: 50%;
  bottom: calc(var(--pad) + env(safe-area-inset-bottom, 0px));
  transform: translateX(-50%);
  text-align: center;
  pointer-events: none;
  transition: opacity 0.8s ease;
  text-shadow: 0 2px 14px rgba(0, 0, 0, 0.9);
}
.hint.is-gone { opacity: 0; }
.hint p { margin: 0 0 8px; }
.hint p:last-child { margin-bottom: 0; }
.hint__keys {
  font: 700 0.68rem/1.9 var(--body);
  letter-spacing: 0.1em;
  text-transform: uppercase;
}
.hint__more, .hint__touch {
  font: 600 0.62rem/1.6 var(--body);
  letter-spacing: 0.11em;
  text-transform: uppercase;
  color: var(--bone-soft);
}
.hint__touch { display: none; }
kbd {
  display: inline-grid;
  place-content: center;
  min-width: 22px;
  height: 22px;
  padding: 0 5px;
  margin: 0 2px;
  border: 1px solid rgba(244, 245, 240, 0.34);
  border-radius: 5px;
  font: 700 0.62rem/1 var(--body);
  background: rgba(244, 245, 240, 0.06);
}
.is-touch .hint__more { display: none; }
.is-touch .hint__keys { display: none; }
.is-touch .hint__touch { display: block; }

/* ---------- cartão da casinha ---------- */

.card {
  position: fixed;
  z-index: 26;
  left: 50%;
  bottom: calc(var(--pad) + 66px + env(safe-area-inset-bottom, 0px));
  transform: translate(-50%, 16px);
  width: min(46ch, calc(100vw - 2 * var(--pad)));
  padding: 18px 20px 20px;
  background: rgba(8, 10, 17, 0.82);
  -webkit-backdrop-filter: blur(14px) saturate(1.1);
  backdrop-filter: blur(14px) saturate(1.1);
  border: 1px solid rgba(244, 245, 240, 0.16);
  border-left: 3px solid var(--signal);
  border-radius: 4px 14px 14px 4px;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: opacity 0.4s ease, transform 0.4s cubic-bezier(0.22, 1, 0.36, 1), visibility 0.4s;
}
.card.is-open {
  opacity: 1;
  visibility: visible;
  transform: translate(-50%, 0);
}
.card__code {
  margin: 0 0 8px;
  font: 700 0.58rem/1 var(--body);
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--signal);
}
.card__title {
  margin: 0 0 10px;
  font: 700 1.7rem/0.98 var(--display);
  letter-spacing: -0.02em;
}
.card__text {
  margin: 0;
  font-size: 0.92rem;
  line-height: 1.58;
  color: rgba(244, 245, 240, 0.82);
}

/* ---------- bússola ---------- */

.compass {
  position: fixed;
  z-index: 24;
  right: var(--pad);
  bottom: calc(var(--pad) + env(safe-area-inset-bottom, 0px));
  display: grid;
  gap: 7px;
  justify-items: end;
  pointer-events: none;
  text-shadow: 0 2px 14px rgba(0, 0, 0, 0.9);
}
.compass span {
  font: 700 0.6rem/1 var(--body);
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--bone-soft);
}
.compass i {
  display: flex;
  gap: 6px;
}
.compass i b {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: rgba(244, 245, 240, 0.26);
  transition: background 0.3s ease, transform 0.3s ease;
}
.compass i b.is-near {
  background: var(--signal);
  transform: scale(1.5);
}

/* ---------- lista acessível ---------- */

.list {
  position: fixed;
  inset: 0;
  z-index: 50;
  overflow-y: auto;
  background: rgba(4, 5, 10, 0.97);
  -webkit-backdrop-filter: blur(6px);
  backdrop-filter: blur(6px);
  padding: calc(var(--pad) + 58px) var(--pad) calc(var(--pad) + 40px);
}
.list[hidden] { display: none; }
.list__inner { max-width: 62ch; margin: 0 auto; }
.list h1 {
  font: 800 clamp(2.4rem, 1.4rem + 4vw, 4rem)/0.9 var(--display);
  letter-spacing: -0.03em;
  text-transform: uppercase;
  margin: 0 0 16px;
}
.list__lead {
  font-size: 1.02rem;
  line-height: 1.6;
  color: rgba(244, 245, 240, 0.78);
  margin: 0 0 40px;
}
.list article {
  padding: 22px 0;
  border-top: 1px solid rgba(244, 245, 240, 0.16);
}
.list article h2 {
  margin: 0 0 8px;
  font: 700 1.5rem/1 var(--display);
  letter-spacing: -0.01em;
}
.list article p {
  margin: 0;
  line-height: 1.62;
  color: rgba(244, 245, 240, 0.76);
}
.list__foot {
  margin: 36px 0 0;
  padding-top: 18px;
  border-top: 1px solid rgba(244, 245, 240, 0.16);
  display: flex;
  justify-content: space-between;
  gap: 16px;
  font: 700 0.6rem/1.5 var(--body);
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--bone-soft);
}
.list__foot a { color: var(--bone); }

.noscript-note {
  position: fixed;
  z-index: 70;
  inset: 0 0 auto 0;
  margin: 0;
  padding: 14px var(--pad);
  background: var(--signal);
  color: var(--void);
  font-size: 0.88rem;
  font-weight: 600;
}

/* ---------- sem WebGL ---------- */

.no-webgl #scene,
.no-webgl .boot,
.no-webgl .hint,
.no-webgl .card,
.no-webgl .compass,
.no-webgl #list-toggle { display: none; }
.no-webgl body { overflow: auto; }
.no-webgl .list {
  position: static;
  display: block !important;
  background: var(--void);
  -webkit-backdrop-filter: none;
  backdrop-filter: none;
}

@media (max-width: 620px) {
  .card { bottom: calc(var(--pad) + 84px + env(safe-area-inset-bottom, 0px)); }
  .card__title { font-size: 1.45rem; }
  .card__text { font-size: 0.87rem; }
  .compass span { display: none; }
}

@media (prefers-reduced-motion: reduce) {
  .card, .hint, .boot { transition-duration: 0.001ms !important; }
}
