:root {
  --bg-top: #181417;
  --bg-bottom: #070709;
  --ink: #fff7d7;
  --muted: rgba(255, 247, 215, 0.72);
  --accent: #ffea00;
  --accent-strong: #ffb800;
  --danger: #ff5f57;
  --panel: rgba(13, 9, 14, 0.68);
  --panel-border: rgba(255, 234, 0, 0.2);
  --shadow: 0 16px 48px rgba(0, 0, 0, 0.35);
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  min-height: 100%;
  width: 100%;
  overflow: hidden;
  background:
    radial-gradient(circle at 50% 0%, rgba(255, 196, 0, 0.14), transparent 32%),
    linear-gradient(180deg, var(--bg-top) 0%, var(--bg-bottom) 100%);
  color: var(--ink);
  font-family: "Helvetica Neue", "PingFang SC", "Microsoft YaHei", sans-serif;
}

button {
  font: inherit;
}

.page-shell {
  position: relative;
  width: 100vw;
  height: 100vh;
  overflow: hidden;
  background: transparent;
  touch-action: none;
}

.camera-feed,
.ar-canvas,
.hud {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}

.camera-feed {
  object-fit: cover;
  transform: none;
  background: #000;
}

.ar-canvas {
  pointer-events: none;
  background: transparent;
}

.build-badge {
  position: absolute;
  top: calc(16px + env(safe-area-inset-top));
  right: 16px;
  z-index: 12;
  padding: 8px 12px;
  border: 1px solid rgba(255, 234, 0, 0.28);
  border-radius: 999px;
  background: rgba(0, 0, 0, 0.42);
  color: var(--ink);
  font-size: 12px;
  letter-spacing: 0.06em;
  backdrop-filter: blur(10px);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.24);
}

.hud {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding:
    calc(20px + env(safe-area-inset-top))
    18px
    calc(18px + env(safe-area-inset-bottom));
  background:
    linear-gradient(180deg, rgba(5, 3, 6, 0.26) 0%, transparent 24%),
    linear-gradient(180deg, transparent 58%, rgba(5, 3, 6, 0.74) 100%);
}

.hud-top {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.tag {
  width: fit-content;
  margin: 0;
  padding: 7px 12px;
  border: 1px solid rgba(255, 234, 0, 0.28);
  border-radius: 999px;
  background: rgba(0, 0, 0, 0.26);
  font-size: 12px;
  letter-spacing: 0.08em;
}

.status-text {
  max-width: min(78vw, 420px);
  margin: 0;
  color: var(--ink);
  font-size: 15px;
  line-height: 1.45;
  text-shadow: 0 2px 12px rgba(0, 0, 0, 0.4);
}

.hud-card {
  width: min(100%, 520px);
  padding: 18px;
  border: 1px solid var(--panel-border);
  border-radius: 22px;
  background: var(--panel);
  backdrop-filter: blur(14px);
  box-shadow: var(--shadow);
}

.hud-card h1 {
  margin: 0 0 10px;
  font-size: clamp(28px, 6vw, 42px);
  line-height: 0.95;
  letter-spacing: -0.04em;
}

.sub-text,
.scene-hint {
  margin: 0;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.55;
}

.action-row {
  display: flex;
  gap: 12px;
  margin: 18px 0 12px;
  flex-wrap: wrap;
}

.primary-button,
.ghost-button {
  min-height: 48px;
  padding: 0 18px;
  border-radius: 999px;
  border: 1px solid rgba(255, 234, 0, 0.28);
  cursor: pointer;
  font: inherit;
}

.primary-button {
  background: linear-gradient(180deg, #ffe36a 0%, #ffb800 100%);
  color: #120b16;
  font-weight: 700;
}

.ghost-button {
  background: rgba(0, 0, 0, 0.28);
  color: var(--ink);
}

.ghost-button:disabled,
.primary-button:disabled {
  cursor: not-allowed;
  opacity: 0.45;
}

.environment-notice {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background: rgba(4, 3, 6, 0.78);
  z-index: 20;
}

.environment-card {
  width: min(92vw, 560px);
  padding: 24px;
  border: 1px solid rgba(255, 95, 87, 0.3);
  border-radius: 24px;
  background: rgba(18, 10, 14, 0.92);
  box-shadow: var(--shadow);
}

.environment-label {
  margin: 0 0 8px;
  color: #ff9f98;
  font-size: 12px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.environment-card h2 {
  margin: 0 0 12px;
  font-size: clamp(24px, 5vw, 34px);
  line-height: 1.06;
}

.environment-message {
  margin: 0;
  color: var(--ink);
  line-height: 1.7;
  white-space: pre-line;
}

.is-hidden {
  display: none;
}

@media (max-width: 640px) {
  .action-row {
    flex-direction: column;
  }

  .primary-button,
  .ghost-button {
    width: 100%;
  }

  .hud-card {
    width: 100%;
  }
}
