:root {
  --panel: rgba(12, 14, 18, 0.82);
  --text: #e8eaef;
  --muted: #9aa3b2;
  --accent: #6eb0ff;
}

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

html,
body {
  margin: 0;
  height: 100%;
  overflow: hidden;
  font-family: system-ui, -apple-system, Segoe UI, Roboto, sans-serif;
  background: #080a0c;
  color: var(--text);
}

#ui-root {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 10;
}

#loader {
  position: absolute;
  inset: 0;
  pointer-events: auto;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 1rem;
  background: radial-gradient(ellipse at 50% 40%, #141820 0%, #06080b 65%);
  transition: opacity 0.5s ease, visibility 0.5s ease;
}

#loader.hidden {
  opacity: 0;
  visibility: hidden;
  pointer-events: none !important;
}

#loader h1 {
  margin: 0;
  font-size: 1.125rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--muted);
}

#progress-wrap {
  width: min(320px, 72vw);
  height: 4px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.08);
  overflow: hidden;
}

#progress-bar {
  height: 100%;
  width: 0%;
  border-radius: inherit;
  background: linear-gradient(90deg, #3d7eef, var(--accent));
  transition: width 0.2s ease;
}

#loader-status {
  font-size: 0.875rem;
  color: var(--muted);
}

#hud {
  position: absolute;
  left: 1rem;
  bottom: 1rem;
  padding: 0.75rem 1rem;
  max-width: min(360px, 92vw);
  border-radius: 10px;
  background: var(--panel);
  border: 1px solid rgba(255, 255, 255, 0.06);
  backdrop-filter: blur(10px);
  font-size: 0.8125rem;
  line-height: 1.45;
  color: rgb(160, 168, 182);
}

#hud strong {
  color: var(--text);
  font-weight: 600;
}

#hud kbd {
  display: inline-block;
  padding: 0.08em 0.4em;
  margin: 0 0.1em;
  border-radius: 4px;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.12);
  font-size: 0.85em;
  font-family: ui-monospace, monospace;
}

#error-toast {
  position: absolute;
  top: 1rem;
  left: 50%;
  transform: translateX(-50%);
  padding: 0.75rem 1rem;
  border-radius: 8px;
  background: rgba(120, 30, 30, 0.92);
  border: 1px solid rgba(255, 120, 120, 0.35);
  font-size: 0.875rem;
  display: none;
  max-width: min(520px, 92vw);
}

#error-toast.visible {
  display: block;
  pointer-events: auto;
}
