* { 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;
}

#intro {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.92);
  z-index: 50;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  overflow-y: auto;
}
#intro.hidden { display: none; }
#intro .box {
  max-width: 520px;
  text-align: center;
  padding: 24px;
}
#intro h1 {
  font-size: 28px;
  font-weight: 700;
  letter-spacing: -0.5px;
  margin-bottom: 8px;
}
#intro .sub {
  font-size: 14px;
  color: rgba(255, 255, 255, 0.7);
  margin-bottom: 24px;
}
#intro .body {
  font-size: 14px;
  line-height: 1.55;
  color: rgba(255, 255, 255, 0.88);
  text-align: left;
  margin-bottom: 24px;
}
#intro .body p { margin-bottom: 12px; }
#intro .footnote {
  font-size: 11px;
  color: rgba(255, 255, 255, 0.45);
  margin-top: 18px;
  line-height: 1.45;
}

button {
  cursor: pointer;
  font-family: inherit;
}

#start-btn {
  padding: 14px 28px;
  font-size: 16px;
  font-weight: 600;
  background: #fff;
  color: #000;
  border: none;
  border-radius: 30px;
  letter-spacing: 0.2px;
}
#start-btn:active { background: #ddd; }

#info-toggle {
  position: fixed;
  top: calc(env(safe-area-inset-top, 0px) + 8px);
  left: calc(env(safe-area-inset-left, 0px) + 12px);
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: rgba(0, 0, 0, 0.55);
  color: #fff;
  border: 1px solid rgba(255, 255, 255, 0.25);
  font-size: 15px;
  font-weight: 700;
  font-style: italic;
  font-family: Georgia, serif;
  line-height: 34px;
  z-index: 20;
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
}

#info-panel {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.9);
  z-index: 40;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 20px;
  overflow-y: auto;
}
#info-panel.open { display: flex; }
#info-panel .info-box {
  max-width: 480px;
  padding: 24px;
  font-size: 14px;
  line-height: 1.55;
}
#info-panel h2 {
  font-size: 20px;
  font-weight: 700;
  margin-bottom: 14px;
}
#info-panel p { margin-bottom: 10px; color: rgba(255, 255, 255, 0.88); }
#info-panel ul { margin: 10px 0 14px 18px; }
#info-panel li { margin-bottom: 8px; color: rgba(255, 255, 255, 0.88); }
#info-panel b { color: #fff; }

#info-close {
  margin-top: 12px;
  padding: 10px 22px;
  font-size: 14px;
  font-weight: 600;
  background: rgba(255, 255, 255, 0.12);
  color: #fff;
  border: 1px solid rgba(255, 255, 255, 0.3);
  border-radius: 22px;
}
