:root {
  --bg: #050507;
  --surface: #17191f;
  --surface-raised: #22252d;
  --border: rgba(255, 255, 255, 0.14);
  --text: #f6f7f9;
  --muted: rgba(246, 247, 249, 0.66);
  --subtle: rgba(246, 247, 249, 0.42);
  --accent: #20c997;
  --accent-strong: #12b886;
  --danger: #ff6b6b;
  --shadow: 0 16px 45px rgba(0, 0, 0, 0.35);
  --radius: 8px;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html,
body {
  width: 100%;
  height: 100%;
  margin: 0;
}

body {
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: var(--text);
  background: var(--bg);
  overflow: hidden;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

button,
input {
  font: inherit;
}

button {
  color: inherit;
}

.hidden {
  display: none !important;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 38px;
  padding: 0 14px;
  color: var(--text);
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  cursor: pointer;
  white-space: nowrap;
}

.btn:hover {
  background: rgba(255, 255, 255, 0.14);
}

.btn:active {
  transform: translateY(1px);
}

.btn:disabled {
  opacity: 0.45;
  cursor: default;
  transform: none;
}

.btn.connected {
  border-color: rgba(32, 201, 151, 0.55);
  background: rgba(32, 201, 151, 0.16);
}

.btn svg {
  width: 18px;
  height: 18px;
  flex: 0 0 auto;
}

.icon-btn {
  width: 38px;
  padding: 0;
}

.loading-overlay {
  position: fixed;
  inset: 0;
  z-index: 50;
  display: grid;
  place-content: center;
  gap: 14px;
  color: var(--text);
  background: rgba(5, 5, 7, 0.78);
}

.spinner {
  width: 34px;
  height: 34px;
  margin: 0 auto;
  border: 3px solid rgba(255, 255, 255, 0.2);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin 800ms linear infinite;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

.toast {
  position: fixed;
  right: 18px;
  bottom: 18px;
  z-index: 60;
  max-width: min(420px, calc(100vw - 36px));
  padding: 10px 14px;
  color: var(--text);
  background: rgba(23, 25, 31, 0.96);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  opacity: 0;
  pointer-events: none;
  transform: translateY(8px);
  transition: opacity 160ms ease, transform 160ms ease;
}

.toast.show {
  opacity: 1;
  transform: translateY(0);
}

.toast.error {
  border-color: rgba(255, 107, 107, 0.65);
}

.laser-pointer {
  position: absolute;
  z-index: 15;
  width: 22px;
  height: 22px;
  border: 2px solid rgba(255, 255, 255, 0.95);
  border-radius: 50%;
  background: rgba(255, 42, 42, 0.92);
  box-shadow:
    0 0 0 4px rgba(255, 42, 42, 0.24),
    0 0 22px rgba(255, 42, 42, 0.75);
  pointer-events: none;
  transform: translate(-50%, -50%);
}
