:root {
  --bg: #070a12;
  --panel: rgba(13, 18, 32, 0.72);
  --panel-border: rgba(246, 214, 140, 0.16);
  --text: #eef1f8;
  --muted: #98a3be;
  --gold: #f5c96b;
  --cyan: #74d9f7;
  --font-sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Inter, Roboto, sans-serif;
  --font-mono: "SF Mono", ui-monospace, SFMono-Regular, Menlo, monospace;
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  padding: 0;
  width: 100%;
  height: 100%;
  overflow: hidden;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-sans);
  user-select: none;
  -webkit-user-select: none;
}

#vesper-canvas {
  display: block;
  width: 100%;
  height: 100%;
  cursor: crosshair;
  touch-action: none;
}

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

.hidden {
  opacity: 0 !important;
  pointer-events: none !important;
  transform: translateY(8px);
}

.top-bar {
  position: fixed;
  top: 16px;
  left: 20px;
  right: 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  z-index: 20;
  transition: opacity 220ms ease, transform 220ms ease;
  pointer-events: none;
}

.brand,
.top-actions {
  pointer-events: auto;
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 8px 14px;
  border-radius: 999px;
  background: var(--panel);
  border: 1px solid var(--panel-border);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
}

.brand-mark {
  color: var(--gold);
  font-size: 16px;
  line-height: 1;
}

.brand-text h1 {
  margin: 0;
  font-size: 12px;
  letter-spacing: 0.28em;
  font-weight: 600;
  color: var(--text);
}

.brand-text p {
  margin: 2px 0 0;
  font-size: 11px;
  color: var(--muted);
  max-width: 34vw;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.top-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.pill-btn,
.tool-btn,
select {
  appearance: none;
  border: 1px solid rgba(255, 255, 255, 0.1);
  background: var(--panel);
  color: var(--text);
  font-family: var(--font-sans);
  font-size: 12px;
  line-height: 1;
  padding: 9px 13px;
  border-radius: 999px;
  cursor: pointer;
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  transition: border-color 160ms ease, background 160ms ease, color 160ms ease, transform 120ms ease;
  display: inline-flex;
  align-items: center;
  gap: 7px;
}

.pill-btn:hover,
.tool-btn:hover,
select:hover {
  border-color: rgba(245, 201, 107, 0.45);
  background: rgba(22, 30, 52, 0.86);
}

.pill-btn:active,
.tool-btn:active {
  transform: scale(0.97);
}

.pill-btn.icon-only {
  width: 32px;
  height: 32px;
  padding: 0;
  justify-content: center;
  font-family: var(--font-mono);
}

.pill-btn.accent {
  border-color: rgba(245, 201, 107, 0.38);
}

.pill-btn.accent.live {
  border-color: rgba(116, 217, 247, 0.52);
  color: #e4f8ff;
}

.pill-btn .dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--gold);
  box-shadow: 0 0 8px rgba(245, 201, 107, 0.7);
}

.pill-btn.live .dot {
  background: var(--cyan);
  box-shadow: 0 0 10px rgba(116, 217, 247, 0.9);
}

.dock {
  position: fixed;
  bottom: 18px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 7px 10px;
  border-radius: 20px;
  background: var(--panel);
  border: 1px solid var(--panel-border);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  box-shadow: 0 18px 42px rgba(0, 0, 0, 0.45);
  max-width: calc(100vw - 24px);
  overflow-x: auto;
  z-index: 20;
  transition: opacity 220ms ease, transform 220ms ease;
}

.dock.hidden {
  transform: translate(-50%, 10px);
}

.dock-group {
  display: flex;
  align-items: center;
  gap: 5px;
  flex-shrink: 0;
}

.dock-divider {
  width: 1px;
  height: 22px;
  background: rgba(255, 255, 255, 0.1);
  flex-shrink: 0;
}

.tool-btn {
  padding: 8px 11px;
  background: rgba(255, 255, 255, 0.03);
}

.tool-btn kbd {
  font-family: var(--font-mono);
  font-size: 10px;
  color: var(--muted);
  background: rgba(255, 255, 255, 0.06);
  padding: 2px 5px;
  border-radius: 4px;
}

.tool-btn.active {
  background: rgba(245, 201, 107, 0.16);
  border-color: rgba(245, 201, 107, 0.58);
  color: #fff3d2;
}

.tool-btn.active kbd {
  color: var(--gold);
}

.preset-btn.active {
  background: rgba(116, 217, 247, 0.14);
  border-color: rgba(116, 217, 247, 0.52);
  color: #dff7ff;
}

select {
  padding: 8px 12px;
  background-color: rgba(255, 255, 255, 0.04);
}

.onboarding-hint {
  position: fixed;
  top: 74px;
  left: 50%;
  transform: translateX(-50%);
  padding: 8px 16px;
  border-radius: 999px;
  background: rgba(14, 20, 36, 0.78);
  border: 1px solid rgba(245, 201, 107, 0.22);
  color: #dbe3f6;
  font-size: 12px;
  z-index: 15;
  pointer-events: none;
  transition: opacity 600ms ease;
}

.onboarding-hint.fade {
  opacity: 0;
}

.toast {
  position: fixed;
  bottom: 84px;
  left: 50%;
  transform: translate(-50%, 6px);
  padding: 8px 16px;
  border-radius: 999px;
  background: rgba(18, 26, 46, 0.92);
  border: 1px solid rgba(116, 217, 247, 0.4);
  color: #e8f8ff;
  font-size: 12px;
  opacity: 0;
  pointer-events: none;
  transition: opacity 200ms ease, transform 200ms ease;
  z-index: 30;
}

.toast.visible {
  opacity: 1;
  transform: translate(-50%, 0);
}

.help-modal {
  position: fixed;
  inset: 0;
  display: grid;
  place-items: center;
  background: rgba(5, 8, 15, 0.58);
  backdrop-filter: blur(8px);
  z-index: 40;
  transition: opacity 180ms ease;
}

.help-card {
  width: min(440px, calc(100vw - 32px));
  padding: 20px 22px;
  border-radius: 18px;
  background: rgba(13, 18, 32, 0.94);
  border: 1px solid var(--panel-border);
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.6);
}

.help-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
}

.help-header h2 {
  margin: 0;
  font-size: 15px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--gold);
}

.help-card ul {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 9px;
  font-size: 13px;
  color: var(--muted);
}

.help-card li strong {
  color: var(--text);
}

.help-card li span {
  display: inline-block;
  min-width: 48px;
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--gold);
}

.restore-hud {
  position: fixed;
  bottom: 16px;
  right: 16px;
  z-index: 25;
  border: 1px solid rgba(255, 255, 255, 0.14);
  background: var(--panel);
  color: var(--muted);
  padding: 7px 12px;
  border-radius: 999px;
  font-size: 11px;
  cursor: pointer;
  transition: opacity 200ms ease;
}

@media (max-width: 820px) {
  .brand-text p {
    display: none;
  }
  .top-bar {
    top: 10px;
    left: 12px;
    right: 12px;
  }
}
