/* 星核·觉醒 —— 界面样式 */
* { margin: 0; padding: 0; box-sizing: border-box; }

html, body {
  width: 100%; height: 100%;
  overflow: hidden;
  background: #03020a;
  font-family: "Segoe UI", "Microsoft YaHei", "PingFang SC", sans-serif;
  -webkit-user-select: none; user-select: none;
}

#stage, #stage canvas {
  position: fixed; inset: 0;
  width: 100%; height: 100%;
  display: block;
  cursor: grab;
}
#stage canvas:active { cursor: grabbing; }

/* ---------- 加载遮罩 ---------- */
#loader {
  position: fixed; inset: 0; z-index: 50;
  background: radial-gradient(circle at 50% 55%, #0b0722 0%, #03020a 70%);
  display: flex; flex-direction: column;
  align-items: center; justify-content: center; gap: 26px;
  transition: opacity .9s ease;
}
#loader.hide { opacity: 0; pointer-events: none; }

#loader .ring {
  width: 64px; height: 64px; border-radius: 50%;
  background: conic-gradient(from 0deg, #41f2c0, #4a6cff, #ff6bd5, #41f2c0);
  -webkit-mask: radial-gradient(farthest-side, transparent 62%, #000 64%);
          mask: radial-gradient(farthest-side, transparent 62%, #000 64%);
  animation: spin 1.1s linear infinite;
  filter: drop-shadow(0 0 12px rgba(90,140,255,.8));
}
@keyframes spin { to { transform: rotate(360deg); } }

#loader .loading-text {
  color: #cfe0ff; font-size: 14px; letter-spacing: .55em; text-indent: .55em;
  opacity: .8;
}

/* ---------- HUD ---------- */
#hud { position: fixed; inset: 0; z-index: 10; pointer-events: none; }

.title { position: absolute; top: 30px; left: 40px; }
.title h1 {
  font-size: 30px; font-weight: 600; letter-spacing: .28em;
  background: linear-gradient(100deg, #9fe8ff 5%, #7f9dff 45%, #e6a5ff 90%);
  -webkit-background-clip: text; background-clip: text;
  -webkit-text-fill-color: transparent; color: transparent;
  filter: drop-shadow(0 0 14px rgba(110,150,255,.45));
}
.title .sub {
  margin-top: 8px;
  font-size: 11px; letter-spacing: .42em;
  color: rgba(190,210,255,.55);
}

.panel {
  position: absolute; top: 30px; right: 36px;
  display: flex; gap: 10px;
  pointer-events: auto;
}
.panel button {
  padding: 9px 16px;
  font-size: 13px; letter-spacing: .18em; text-indent: .18em;
  color: #cfe2ff;
  background: rgba(16, 18, 46, .55);
  border: 1px solid rgba(130, 165, 255, .32);
  border-radius: 999px;
  cursor: pointer;
  backdrop-filter: blur(6px);
  transition: all .22s ease;
}
.panel button:hover {
  border-color: rgba(150, 230, 255, .8);
  box-shadow: 0 0 16px rgba(90, 150, 255, .45), inset 0 0 10px rgba(90, 150, 255, .18);
  color: #ffffff;
}
.panel button.on { border-color: rgba(120, 235, 205, .55); color: #d8fff4; }
.panel button.off { opacity: .45; }

.hint {
  position: absolute; bottom: 28px; left: 50%; transform: translateX(-50%);
  font-size: 12px; letter-spacing: .3em; text-indent: .3em;
  color: rgba(200, 218, 255, .5);
  white-space: nowrap;
}

.credit {
  position: absolute; bottom: 28px; right: 36px;
  font-size: 11px; letter-spacing: .1em;
  color: rgba(170, 185, 230, .35);
}

@media (max-width: 720px) {
  .title { top: 22px; left: 22px; }
  .title h1 { font-size: 22px; }
  .panel { top: auto; bottom: 70px; right: 50%; transform: translateX(50%); }
  .hint { bottom: 30px; font-size: 10px; letter-spacing: .18em; }
  .credit { display: none; }
}

/* ---------- WebGL 不可用 ---------- */
#nogl {
  position: fixed; inset: 0; z-index: 60;
  display: flex; align-items: center; justify-content: center;
  background: #05040f; color: #9fb4e8;
  font-size: 15px; line-height: 2; letter-spacing: .12em; text-align: center;
}
#nogl[hidden] { display: none; }
