* { box-sizing: border-box; }

html, body {
  margin: 0;
  height: 100%;
  overflow: hidden;
  background: #0a0803;
  color: #efe6c4;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "Microsoft YaHei", sans-serif;
  -webkit-user-select: none;
  user-select: none;
  -webkit-tap-highlight-color: transparent;
  touch-action: none;
}

#game {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  display: block;
  image-rendering: pixelated;
  cursor: crosshair;
}

/* ---------- HUD ---------- */
.hud {
  position: fixed;
  z-index: 6;
  top: 0; left: 0;
  padding: 14px 20px 40px 16px;
  pointer-events: none;
  text-shadow: 0 1px 4px rgba(0, 0, 0, 0.95), 0 0 12px rgba(0, 0, 0, 0.8);
  background: linear-gradient(120deg, rgba(10, 8, 3, 0.72), rgba(10, 8, 3, 0.35) 55%, transparent 78%);
  border-bottom-right-radius: 60px;
}

.hud-line {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 12px;
  letter-spacing: 2px;
}

.tag {
  border: 1px solid rgba(239, 230, 196, 0.35);
  border-radius: 4px;
  padding: 2px 7px;
  color: #efe6c4;
  font-weight: 700;
}

.timer {
  font-variant-numeric: tabular-nums;
  color: rgba(239, 230, 196, 0.7);
}

.obj {
  margin-top: 8px;
  font-size: 13.5px;
  color: rgba(250, 244, 214, 0.92);
  letter-spacing: 1px;
}

.obj.warn { color: #ffd166; }
.obj.near { color: #8affc1; }

.tips {
  position: fixed;
  z-index: 6;
  left: 16px;
  bottom: 14px;
  font-size: 11px;
  line-height: 1.7;
  color: rgba(239, 230, 196, 0.45);
  pointer-events: none;
  transition: opacity 1.2s;
}

.tips.hide { opacity: 0; }

.sound {
  position: fixed;
  z-index: 7;
  top: 12px; right: 12px;
  width: 40px; height: 40px;
  border-radius: 50%;
  border: 1px solid rgba(239, 230, 196, 0.25);
  background: rgba(20, 16, 5, 0.55);
  color: #efe6c4;
  font-size: 15px;
  cursor: pointer;
  backdrop-filter: blur(4px);
}

.sound[aria-pressed="false"] { opacity: 0.4; }

/* ---------- 开始 / 结束浮层 ---------- */
.overlay {
  position: fixed;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  background: rgba(8, 7, 3, 0.82);
  backdrop-filter: blur(6px);
  z-index: 20;
}

.overlay.hidden { display: none; }

.card {
  width: min(92vw, 460px);
  padding: 32px 28px 26px;
  border-radius: 18px;
  background: linear-gradient(180deg, rgba(38, 32, 12, 0.97), rgba(18, 15, 6, 0.97));
  border: 1px solid rgba(239, 230, 196, 0.18);
  box-shadow: 0 24px 70px rgba(0, 0, 0, 0.7);
  text-align: center;
}

.card .icon {
  font-size: 40px;
  line-height: 1;
  color: #c7b768;
  letter-spacing: -4px;
  margin-bottom: 10px;
}

.card h2 {
  margin: 0 0 14px;
  font-size: 21px;
  font-weight: 800;
  letter-spacing: 1px;
}

.card .line {
  margin: 0 0 24px;
  font-size: 13.5px;
  line-height: 2;
  color: rgba(239, 230, 196, 0.72);
}

button.primary {
  padding: 13px 40px;
  border-radius: 999px;
  border: 1px solid rgba(255, 236, 160, 0.45);
  background: linear-gradient(180deg, #d8c56d, #b8a24e);
  color: #1b1607;
  font-size: 15px;
  font-weight: 800;
  letter-spacing: 2px;
  cursor: pointer;
}

button.primary:active { transform: scale(0.98); }

/* ---------- 手机摇杆 ---------- */
.stick {
  position: fixed;
  width: 54px; height: 54px;
  margin: -27px 0 0 -27px;
  border-radius: 50%;
  border: 2px solid rgba(239, 230, 196, 0.35);
  background: rgba(239, 230, 196, 0.08);
  pointer-events: none;
  display: none;
  z-index: 10;
}

.stick::after {
  content: "";
  position: absolute;
  inset: 16px;
  border-radius: 50%;
  background: rgba(239, 230, 196, 0.5);
}

.stick.on { display: block; }

/* 手电筒扫描线，增加一点老录像带的脏感 */
.vignette {
  position: fixed;
  inset: 0;
  pointer-events: none;
  background: radial-gradient(120% 95% at 50% 48%, transparent 52%, rgba(0, 0, 0, 0.42) 100%);
  z-index: 5;
}

#minimap {
  position: fixed;
  top: 62px;
  right: 14px;
  width: 148px;
  height: 148px;
  border-radius: 50%;
  border: 1px solid rgba(239, 230, 196, 0.22);
  background: rgba(10, 9, 4, 0.4);
  box-shadow: 0 8px 26px rgba(0, 0, 0, 0.45);
  z-index: 6;
  pointer-events: none;
}

@media (max-width: 700px) {
  #minimap {
    width: 112px;
    height: 112px;
    top: 58px;
    right: 10px;
  }
}

@media (max-width: 700px) {
  .tips { display: none; }
}
