:root {
  --tint: #9fe8ff;
  --accent: #ff9e64;
  --bg: #04070c;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  height: 100%;
  overflow: hidden;
  background: var(--bg);
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  color: var(--tint);
  transition: background 600ms ease;
}

#app, #app canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  display: block;
  touch-action: none;
  cursor: grab;
}
#app canvas:active { cursor: grabbing; }

#tracker {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 5;
}

#frame {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 10;
  opacity: .85;
  transition: opacity 500ms ease;
}
#frame::before, #frame::after {
  content: '';
  position: absolute;
  left: 64px;
  right: 64px;
  height: 5px;
  background: repeating-linear-gradient(to right, var(--tint) 0 1px, transparent 1px 26px);
  opacity: .28;
  transition: background 600ms ease;
}
#frame::before { top: 36px; }
#frame::after { bottom: 36px; }

.corner {
  position: absolute;
  width: 34px;
  height: 34px;
  border: 1px solid var(--tint);
  opacity: .55;
  transition: border-color 600ms ease;
}
.corner.tl { top: 14px; left: 14px; border-right: 0; border-bottom: 0; }
.corner.tr { top: 14px; right: 14px; border-left: 0; border-bottom: 0; }
.corner.bl { bottom: 14px; left: 14px; border-right: 0; border-top: 0; }
.corner.br { bottom: 14px; right: 14px; border-left: 0; border-top: 0; }

header {
  position: absolute;
  top: 20px;
  left: 64px;
  right: 64px;
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 16px;
  letter-spacing: .14em;
  font-size: 11px;
}

#brand {
  white-space: nowrap;
  color: var(--tint);
}
#brand.flash { animation: brandflash 700ms ease; }
@keyframes brandflash {
  0% { text-shadow: 0 0 18px var(--accent); transform: translateY(-1px); }
  100% { text-shadow: none; transform: none; }
}

#status {
  color: var(--tint);
  opacity: .7;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

footer {
  position: absolute;
  bottom: 18px;
  left: 64px;
  right: 64px;
  display: flex;
  justify-content: center;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  font-size: 9px;
  letter-spacing: .18em;
  opacity: .5;
}
footer i {
  width: 4px;
  height: 4px;
  background: currentColor;
  transform: rotate(45deg);
  opacity: .6;
}

#navbtns {
  position: fixed;
  right: 20px;
  bottom: 96px;
  z-index: 20;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
#navbtns button {
  padding: 8px 14px;
  background: rgba(0, 0, 0, .35);
  border: 1px solid color-mix(in srgb, var(--tint) 55%, transparent);
  color: var(--tint);
  font-family: inherit;
  font-size: 10px;
  letter-spacing: .2em;
  cursor: pointer;
  transition: border-color 300ms ease, color 300ms ease;
}
#navbtns button:hover {
  border-color: var(--accent);
  color: var(--accent);
}

#xrbtn {
  position: fixed;
  left: 50%;
  bottom: 52px;
  transform: translateX(-50%);
  z-index: 20;
  display: none;
  padding: 10px 22px;
  background: rgba(0, 0, 0, .35);
  border: 1px solid var(--tint);
  color: var(--tint);
  font-family: inherit;
  font-size: 11px;
  letter-spacing: .22em;
  cursor: pointer;
  transition: border-color 400ms ease, box-shadow 400ms ease, color 400ms ease;
}
#xrbtn:hover, #xrbtn:focus-visible {
  box-shadow: 0 0 18px color-mix(in srgb, var(--accent) 55%, transparent);
  border-color: var(--accent);
  color: var(--accent);
  outline: none;
}
body.xr #xrbtn { border-color: var(--accent); color: var(--accent); }

#vignette {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 6;
  background: radial-gradient(ellipse at center, transparent 52%, rgba(0,0,0,.62) 100%);
}

#scanlines {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 7;
  background: repeating-linear-gradient(to bottom, rgba(255,255,255,.025) 0 1px, transparent 1px 3px);
  mix-blend-mode: overlay;
}

#grain {
  position: fixed;
  inset: -60px;
  pointer-events: none;
  z-index: 8;
  opacity: .55;
  animation: grainjitter 900ms steps(3) infinite;
}
@keyframes grainjitter {
  0% { transform: translate(0, 0); }
  33% { transform: translate(-22px, 14px); }
  66% { transform: translate(16px, -26px); }
  100% { transform: translate(0, 0); }
}

#boot {
  position: fixed;
  inset: 0;
  z-index: 50;
  background: #000;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  letter-spacing: .3em;
  color: #6d8894;
  transition: opacity 1100ms ease;
}
#boot.off { opacity: 0; pointer-events: none; }

body.no-hud #frame,
body.no-hud #tracker,
body.no-hud #scanlines,
body.no-hud #grain { display: none; }
body.no-hud #vignette { opacity: .4; }

@media (max-width: 640px) {
  header { left: 58px; right: 58px; font-size: 10px; }
  footer { left: 24px; right: 24px; font-size: 8px; }
  footer span:nth-child(n+7) { display: none; }
}

#versions {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  z-index: 30;
  display: none;
  width: min(680px, 92vw);
  max-height: 78vh;
  overflow-y: auto;
  background: rgba(4, 8, 12, .92);
  border: 1px solid var(--tint);
  padding: 14px 16px;
  font-size: 10px;
  letter-spacing: .06em;
  cursor: pointer;
}
#versions.on { display: block; }
#versions .vhead {
  font-weight: 700;
  letter-spacing: .18em;
  margin-bottom: 10px;
  padding-bottom: 8px;
  border-bottom: 1px solid color-mix(in srgb, var(--tint) 40%, transparent);
}
#versions .vrow {
  display: grid;
  grid-template-columns: 84px 44px 76px 1fr;
  gap: 10px;
  padding: 3px 0;
  opacity: .85;
}
#versions .vv { color: var(--accent); }
#versions .vfoot {
  margin-top: 10px;
  padding-top: 8px;
  border-top: 1px solid color-mix(in srgb, var(--tint) 25%, transparent);
  opacity: .5;
  font-size: 9px;
}
