:root {
  color-scheme: dark;
  --ink: #fff8df;
  --muted: #c6cce6;
  --panel: rgba(9, 14, 25, 0.58);
  --line: rgba(255, 255, 255, 0.2);
  --gold: #ffd878;
}

* {
  box-sizing: border-box;
}

html,
body {
  width: 100%;
  height: 100%;
  margin: 0;
  overflow: hidden;
  background: #030611;
  color: var(--ink);
  font: 13px/1.35 system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

#world {
  position: fixed;
  inset: 0;
  width: 100vw;
  height: 100vh;
  display: block;
  outline: none;
  background: #030611;
}

#world:focus-visible {
  box-shadow: inset 0 0 0 3px rgba(255, 216, 120, 0.9);
}

#hud {
  position: fixed;
  top: 14px;
  right: 14px;
  z-index: 2;
  min-width: 210px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: linear-gradient(135deg, rgba(7, 11, 22, 0.82), rgba(21, 20, 31, 0.54));
  box-shadow: 0 18px 44px rgba(0, 0, 0, 0.32);
  backdrop-filter: blur(10px);
  pointer-events: none;
}

#hud div {
  display: grid;
  grid-template-columns: 68px 1fr;
  gap: 10px;
  align-items: baseline;
  min-height: 22px;
}

#hud span {
  color: var(--muted);
  text-transform: uppercase;
  font-size: 10px;
  letter-spacing: 0.08em;
}

#hud strong {
  min-width: 0;
  color: var(--ink);
  font-size: 13px;
  font-weight: 780;
  overflow-wrap: anywhere;
}

#hint {
  position: fixed;
  left: 14px;
  bottom: 14px;
  z-index: 2;
  max-width: calc(100vw - 28px);
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(9, 14, 25, 0.66);
  box-shadow: 0 14px 34px rgba(0, 0, 0, 0.28);
  color: var(--ink);
  transition: opacity 1.2s ease;
  pointer-events: none;
}

#status {
  position: fixed;
  left: 50%;
  top: 18px;
  z-index: 3;
  transform: translateX(-50%);
  max-width: calc(100vw - 32px);
  padding: 8px 12px;
  border: 1px solid rgba(255, 216, 120, 0.34);
  border-radius: 8px;
  background: rgba(7, 10, 20, 0.76);
  color: var(--gold);
  opacity: 0;
  transition: opacity 0.18s ease;
  pointer-events: none;
}

#boot {
  position: fixed;
  left: 50%;
  top: 50%;
  z-index: 4;
  transform: translate(-50%, -50%);
  width: min(440px, calc(100vw - 32px));
  padding: 12px 14px;
  border: 1px solid rgba(255, 216, 120, 0.34);
  border-radius: 8px;
  background: rgba(7, 10, 20, 0.78);
  color: var(--gold);
  text-align: center;
  box-shadow: 0 18px 44px rgba(0, 0, 0, 0.34);
  backdrop-filter: blur(8px);
  pointer-events: none;
}

#boot.is-hidden {
  display: none;
}

#boot.is-error {
  color: #ffd4c4;
  border-color: rgba(255, 130, 96, 0.52);
}

body.reduced-motion #hint,
body.reduced-motion #status {
  transition: none;
}

@media (max-width: 560px) {
  #hud {
    min-width: 178px;
    padding: 9px 10px;
  }

  #hud div {
    grid-template-columns: 56px 1fr;
  }

  #hint {
    font-size: 12px;
  }
}
