* { margin: 0; padding: 0; box-sizing: border-box; }

html, body {
  height: 100%;
  overflow: hidden;
  background: #000;
  color: #fff;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  -webkit-user-select: none;
  user-select: none;
  -webkit-tap-highlight-color: transparent;
}

#gl {
  position: fixed;
  inset: 0;
  width: 100vw;
  height: 100vh;
  display: block;
  touch-action: manipulation;
}

#boot {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  padding: calc(env(safe-area-inset-top, 0px) + 10px) 14px 10px 14px;
  background: #c81e5a;
  color: #fff;
  font-size: 16px;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  letter-spacing: 0.4px;
  text-align: center;
  z-index: 100;
  pointer-events: none;
}
#boot.ok   { background: #1a8a3b; }
#boot.err  { background: #b91c1c; text-align: left; font-size: 13px; font-weight: 500; }
#boot.hide { display: none; }

#version {
  position: fixed;
  top: calc(env(safe-area-inset-top, 0px) + 10px);
  right: calc(env(safe-area-inset-right, 0px) + 14px);
  font-size: 11px;
  font-variant-numeric: tabular-nums;
  color: rgba(255, 255, 255, 0.5);
  text-shadow: 0 0 4px rgba(0, 0, 0, 0.8);
  pointer-events: none;
  z-index: 10;
  letter-spacing: 0.3px;
}

#fps {
  position: fixed;
  top: calc(env(safe-area-inset-top, 0px) + 28px);
  right: calc(env(safe-area-inset-right, 0px) + 14px);
  font-size: 12px;
  font-variant-numeric: tabular-nums;
  color: rgba(255, 255, 255, 0.7);
  text-shadow: 0 0 4px rgba(0, 0, 0, 0.8);
  pointer-events: none;
  z-index: 10;
}

#status {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  text-align: center;
  pointer-events: none;
  z-index: 5;
  text-shadow: 0 0 8px rgba(0, 0, 0, 0.9);
}
#status .title { font-size: 22px; font-weight: 600; margin-bottom: 6px; letter-spacing: 0.3px; }
#status .sub   { font-size: 14px; opacity: 0.85; }
#status .hint  { font-size: 11px; opacity: 0.55; margin-top: 10px; }
#status.hidden { display: none; }

#ui-toggle {
  position: fixed;
  top: calc(env(safe-area-inset-top, 0px) + 8px);
  left: calc(env(safe-area-inset-left, 0px) + 12px);
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: rgba(0, 0, 0, 0.55);
  color: #fff;
  border: 1px solid rgba(255, 255, 255, 0.25);
  font-size: 18px;
  line-height: 36px;
  cursor: pointer;
  z-index: 20;
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
}

#panel {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  padding: 14px calc(env(safe-area-inset-right, 0px) + 20px)
          calc(env(safe-area-inset-bottom, 0px) + 14px)
          calc(env(safe-area-inset-left, 0px) + 20px);
  background: rgba(0, 0, 0, 0.72);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  display: none;
  flex-direction: column;
  gap: 10px;
  font-size: 13px;
  z-index: 15;
}
#panel.open { display: flex; }

#panel label {
  display: grid;
  grid-template-columns: 110px 1fr 56px;
  align-items: center;
  gap: 10px;
}
#panel .lbl { font-size: 12px; opacity: 0.8; }
#panel input[type=range] { width: 100%; accent-color: #fff; }
#panel output {
  font-variant-numeric: tabular-nums;
  font-size: 12px;
  text-align: right;
  opacity: 0.85;
}
#panel .note {
  font-size: 11px;
  opacity: 0.55;
  line-height: 1.4;
}
