:root {
  --bg: #0b0c10;
  --amber: #ff9e3d;
  --text: #d9dbe0;
  --dim: #6b6f78;
  color-scheme: dark;
}

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

html,
body,
#app {
  width: 100%;
  height: 100%;
  overflow: hidden;
  background: var(--bg);
  font-family: 'Space Grotesk', 'PingFang SC', 'Helvetica Neue', sans-serif;
  color: var(--text);
}

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

.vignette {
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: radial-gradient(120% 90% at 50% 40%, transparent 55%, rgba(0, 0, 0, 0.5) 100%);
}

/* 嵌入模式（作为 iframe 内嵌到其它页面时）：隐藏头尾 HUD，只留 3D 场景 */
body.embed .hud,
body.embed #loader p {
  display: none;
}

/* ---------- HUD ---------- */
.hud {
  position: absolute;
  left: 0;
  right: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 22px 30px;
  pointer-events: none;
  z-index: 5;
}
.hud-top {
  top: 0;
}
.hud-bottom {
  bottom: 0;
  justify-content: center;
}

.brand {
  font-weight: 700;
  font-size: 22px;
  letter-spacing: 0.06em;
}
.brand span {
  display: block;
  font-size: 10px;
  font-weight: 500;
  letter-spacing: 0.42em;
  color: var(--dim);
  margin-top: 2px;
}

.tips {
  font-size: 12px;
  color: var(--dim);
  letter-spacing: 0.12em;
}

.keys {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 22px;
  justify-content: center;
  font-size: 12px;
  color: var(--dim);
  letter-spacing: 0.04em;
}
.keys kbd {
  display: inline-block;
  min-width: 20px;
  text-align: center;
  padding: 2px 6px;
  margin-right: 6px;
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-bottom-width: 2px;
  border-radius: 5px;
  font-family: inherit;
  font-size: 11px;
  color: var(--text);
  background: rgba(255, 255, 255, 0.04);
}
.keys .drop-tip {
  color: var(--amber);
  opacity: 0.85;
}

/* ---------- 拖放提示 ---------- */
#drop-hint {
  position: absolute;
  inset: 18px;
  border: 2px dashed rgba(255, 158, 61, 0.65);
  border-radius: 22px;
  background: rgba(11, 12, 16, 0.55);
  backdrop-filter: blur(4px);
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  font-size: 22px;
  line-height: 1.8;
  color: var(--amber);
  letter-spacing: 0.1em;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s ease;
  z-index: 20;
}
#drop-hint.show {
  opacity: 1;
}

/* ---------- 加载动画 ---------- */
#loader {
  position: absolute;
  inset: 0;
  background: var(--bg);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 26px;
  z-index: 50;
  transition: opacity 0.6s ease;
}
#loader.hide {
  opacity: 0;
  pointer-events: none;
}
#loader p {
  font-size: 13px;
  letter-spacing: 0.28em;
  color: var(--dim);
}

.cassette-load {
  width: 120px;
  height: 74px;
  border: 2px solid rgba(255, 255, 255, 0.22);
  border-radius: 10px;
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 34px;
}
.cassette-load::before {
  content: '';
  position: absolute;
  top: 10px;
  left: 12px;
  right: 12px;
  height: 14px;
  border-radius: 4px;
  background: linear-gradient(90deg, var(--amber), #ff7a3d);
  opacity: 0.9;
}
.cassette-load i {
  width: 26px;
  height: 26px;
  margin-top: 18px;
  border: 3px solid var(--amber);
  border-radius: 50%;
  border-left-color: transparent;
  animation: spin 1s linear infinite;
}
@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

@media (max-width: 640px) {
  .hud {
    padding: 16px 18px;
  }
  .tips {
    display: none;
  }
  .keys {
    font-size: 11px;
    gap: 8px 14px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .cassette-load i {
    animation-duration: 3s;
  }
}
