:root {
  --surface: rgba(10, 18, 30, 0.72);
  --surface-strong: rgba(9, 15, 26, 0.86);
  --border: rgba(214, 232, 246, 0.2);
  --foreground: #eaf2f8;
  --muted: rgba(214, 232, 246, 0.72);
  --accent: #ffb454;
  --accent-foreground: #241705;
}

* {
  box-sizing: border-box;
}

html,
body {
  height: 100%;
}

body {
  margin: 0;
  overflow: hidden;
  background: #0a1322;
  color: var(--foreground);
  font-family: system-ui, -apple-system, "Segoe UI", "Microsoft YaHei", sans-serif;
  -webkit-font-smoothing: antialiased;
}

.scene-shell {
  position: fixed;
  inset: 0;
}

#scene {
  display: block;
  width: 100%;
  height: 100%;
  touch-action: none;
  cursor: grab;
}

#scene.is-dragging {
  cursor: grabbing;
}

#scene.is-hovering {
  cursor: pointer;
}

.brand {
  position: absolute;
  top: calc(18px + env(safe-area-inset-top));
  left: 20px;
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 0;
  font-size: 13px;
  color: var(--foreground);
  opacity: 0.82;
  pointer-events: none;
}

.brand-mark {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--accent);
}

.toolbar {
  position: absolute;
  left: 0;
  right: 0;
  bottom: calc(18px + env(safe-area-inset-bottom));
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 10px;
  padding: 0 16px;
}

.btn {
  min-height: 40px;
  padding: 0 16px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--surface);
  color: var(--foreground);
  font: inherit;
  font-size: 14px;
  line-height: 1;
  cursor: pointer;
  backdrop-filter: blur(10px);
  transition: background-color 160ms ease, color 160ms ease, border-color 160ms ease;
}

.btn:hover {
  border-color: rgba(214, 232, 246, 0.4);
}

.btn[aria-pressed="true"] {
  background: var(--accent);
  border-color: transparent;
  color: var(--accent-foreground);
}

.btn:focus-visible {
  outline: 2px solid #ffd08a;
  outline-offset: 2px;
}

.btn-ghost {
  background: transparent;
  border-color: transparent;
  color: var(--muted);
  padding: 0 10px;
}

.selection {
  position: absolute;
  left: 20px;
  bottom: calc(78px + env(safe-area-inset-bottom));
  display: flex;
  align-items: flex-start;
  gap: 10px;
  width: min(330px, calc(100vw - 40px));
  padding: 14px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--surface-strong);
  backdrop-filter: blur(12px);
}

.selection-body {
  flex: 1 1 auto;
  min-width: 0;
}

.selection-label {
  margin: 0;
  font-size: 14px;
  font-weight: 500;
}

.selection-desc {
  margin: 6px 0 0;
  font-size: 12px;
  line-height: 1.5;
  color: var(--muted);
}

.fallback {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  margin: 0;
  padding: 16px 20px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--surface-strong);
  font-size: 14px;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}

@media (max-width: 600px) {
  .selection {
    left: 12px;
    right: 12px;
    width: auto;
    bottom: calc(112px + env(safe-area-inset-bottom));
  }

  .toolbar {
    gap: 8px;
    padding: 0 12px;
  }

  .btn {
    flex: 1 1 auto;
  }
}

@media (pointer: coarse) {
  .btn {
    min-height: 46px;
  }
}

.selection[hidden],
.fallback[hidden] {
  display: none;
}

.btn {
  white-space: nowrap;
}