/* Base compartida: colores, tipografías, marco pixel, aviso (toast) y utilidades. */
:root {
  --night-0: #050524;
  --night-1: #0a0a38;
  --night-2: #10104f;
  --indigo: #3d3fe0;
  --violet: #6a3df0;
  --lilac: #d9d4ff;
  --mute: #9a95d6;
  --pink: #ff5fa2;
  --display: 'Pixelify Sans', 'Courier New', monospace;
  --ui: 'Silkscreen', 'Courier New', monospace;
  --mono: 'IBM Plex Mono', ui-monospace, 'Courier New', monospace;
  --sans: 'Sora', 'Segoe UI', system-ui, sans-serif;
  color-scheme: dark;
}

[hidden] { display: none !important; }

html { scroll-behavior: smooth; background: var(--night-0); }
html.is-transitioning { overflow: hidden; }

body {
  margin: 0;
  background: var(--night-0);
  color: var(--lilac);
  font: 400 15px/1.6 var(--sans);
}

a { color: inherit; }
:focus-visible { outline: 3px dashed #fff; outline-offset: 3px; }

.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;
}

/* Marco pixel con esquinas marcadas, usado en paneles, tarjetas y avisos */
.frame {
  --fc: #5b4bff;
  --fh: #9a82ff;
  position: relative;
  box-sizing: border-box;
  background: rgba(8, 8, 52, 0.85);
  border: 2px solid var(--fc);
  border-radius: 4px;
  box-shadow: 0 0 0 2px #04041f, 0 0 22px rgba(80, 64, 255, 0.28);
}
.frame::before {
  content: "";
  position: absolute;
  inset: -5px;
  pointer-events: none;
  background:
    linear-gradient(var(--fh), var(--fh)) 0 0 / 14px 4px no-repeat,
    linear-gradient(var(--fh), var(--fh)) 0 0 / 4px 14px no-repeat,
    linear-gradient(var(--fh), var(--fh)) 100% 0 / 14px 4px no-repeat,
    linear-gradient(var(--fh), var(--fh)) 100% 0 / 4px 14px no-repeat,
    linear-gradient(var(--fh), var(--fh)) 0 100% / 14px 4px no-repeat,
    linear-gradient(var(--fh), var(--fh)) 0 100% / 4px 14px no-repeat,
    linear-gradient(var(--fh), var(--fh)) 100% 100% / 14px 4px no-repeat,
    linear-gradient(var(--fh), var(--fh)) 100% 100% / 4px 14px no-repeat;
}

/* Aviso breve (por ejemplo, cuando algo aún no está conectado) */
.toast {
  position: fixed;
  left: 50%;
  bottom: calc(24px + env(safe-area-inset-bottom, 0px));
  transform: translateX(-50%);
  z-index: 1100;
  box-sizing: border-box;
  width: max-content;
  max-width: min(440px, calc(100% - 32px));
  padding: 14px 18px;
  color: #fff;
  font: 400 0.78rem / 1.5 var(--ui);
  letter-spacing: 0.08em;
  text-align: center;
  text-transform: uppercase;
  animation: toast-in 0.3s steps(4) both;
}
@keyframes toast-in {
  from { transform: translate(-50%, 14px); opacity: 0; }
  to { transform: translate(-50%, 0); opacity: 1; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .toast { animation: none; }
}
