:root {
  color-scheme: dark;
  --sanity: 0.1;
  --flicker: 1;
}

* { box-sizing: border-box; }

[hidden] { display: none !important; }

html, body {
  margin: 0;
  height: 100%;
  background: #050403;
  color: #e6d7c3;
  font-family: "Iowan Old Style", Palatino, "Palatino Linotype", Georgia, serif;
  overflow: hidden;
}

#view { display: block; width: 100%; height: 100%; }

#vignette {
  pointer-events: none;
  position: fixed;
  inset: 0;
  box-shadow: inset 0 0 18vh 8vh rgba(0, 0, 0, calc(0.35 + var(--sanity) * 0.6));
  background: radial-gradient(ellipse at center, transparent 40%, rgba(40, 0, 0, calc(var(--sanity) * 0.28)) 100%);
  mix-blend-mode: multiply;
}

#flicker {
  pointer-events: none;
  position: fixed;
  inset: 0;
  background: rgba(255, 244, 214, 0.05);
  opacity: 0;
}

#flicker.on { animation: blink 90ms steps(2) infinite; }

@keyframes blink {
  50% { opacity: calc(0.18 * var(--flicker)); }
}

#hud, #boot {
  position: fixed;
  left: 0;
  right: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.4rem;
}

#hud { bottom: 7vh; pointer-events: none; }

#boot {
  inset: 0;
  justify-content: center;
  background: rgba(5, 4, 3, 0.72);
  text-align: center;
  cursor: pointer;
}

#boot h1 {
  font-weight: 500;
  letter-spacing: 0.18em;
  font-size: 1.1rem;
  margin: 0 0 0.6rem;
}

#boot p, #hint, #message, #prompt {
  margin: 0;
  max-width: 38rem;
  line-height: 1.45;
}

#prompt {
  min-height: 1.4rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  font-size: 0.82rem;
}

#message { font-size: 0.95rem; min-height: 1.4rem; text-align: center; padding: 0 1.2rem; }

#bars {
  display: flex;
  gap: 1.2rem;
  width: min(28rem, 86vw);
}

.bar { flex: 1; }

.bar span {
  display: block;
  font-size: 0.68rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  opacity: 0.7;
}

.track {
  height: 4px;
  background: rgba(230, 215, 195, 0.15);
  margin-top: 0.25rem;
}

.fill { height: 100%; background: #d8c3a0; width: 0; }

#sanity-fill { background: #8d3b3b; }

#crosshair {
  position: fixed;
  left: 50%;
  top: 50%;
  width: 8px;
  height: 8px;
  margin: -4px 0 0 -4px;
  border: 1px solid rgba(230, 215, 195, 0.7);
  border-radius: 50%;
  pointer-events: none;
}

#hint { opacity: 0.55; font-size: 0.78rem; }
