:root {
  --bg-deep: #0a0e1a;
  --bg: #0c1424;
  --panel: #24314e;
  --panel-2: #155e75;
  --accent: #22d3ee;
  --text: #ffffff;
  --text-muted: #94a3b8;
  --text-dim: #5b6b84;
  --font: Calibri, "Segoe UI", system-ui, -apple-system, sans-serif;
}

* {
  box-sizing: border-box;
}

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

body {
  height: 100dvh;
  width: 100dvw;
}

a {
  color: inherit;
}

button {
  font-family: inherit;
  cursor: pointer;
}

/* ---- Fullscreen toggle button, shared across every page ---- */
/* Invisible until the mouse reaches its corner — chrome stays out of the way. */
.fullscreen-btn {
  position: fixed;
  top: 1.25rem;
  right: 1.25rem;
  z-index: 1000;
  width: 2.75rem;
  height: 2.75rem;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 0.6rem;
  border: 1px solid rgba(148, 163, 184, 0.35);
  background: rgba(36, 49, 78, 0.7);
  color: var(--text-muted);
  backdrop-filter: blur(6px);
  opacity: 0;
  transition: opacity 0.25s ease, background 0.2s ease, color 0.2s ease, transform 0.2s ease;
}

.fullscreen-btn:hover,
.fullscreen-btn:focus-visible {
  opacity: 1;
  background: var(--panel-2);
  color: var(--text);
  transform: scale(1.05);
}

.fullscreen-btn:focus {
  outline: none;
}

.fullscreen-btn svg {
  width: 1.15rem;
  height: 1.15rem;
}

.fade-in {
  animation: fadeIn 0.6s ease both;
}

@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* ---- Shared ambient background: drifting glow + faint grid, used on
   login/home/deck so the whole app reads as one system, not "classic" flat panels. ---- */
.ambient-bg {
  background-color: #070a12;
  background-image: radial-gradient(circle at 18% 22%, rgba(34, 211, 238, 0.09), transparent 42%),
    radial-gradient(circle at 82% 78%, rgba(21, 94, 117, 0.24), transparent 48%),
    radial-gradient(circle at 50% 100%, rgba(124, 58, 237, 0.05), transparent 55%),
    linear-gradient(rgba(148, 163, 184, 0.018) 1px, transparent 1px),
    linear-gradient(90deg, rgba(148, 163, 184, 0.018) 1px, transparent 1px);
  background-size: 140% 140%, 140% 140%, 140% 140%, 44px 44px, 44px 44px;
  background-position: 0% 0%, 100% 100%, 50% 100%, center, center;
  animation: ambientDrift 22s ease-in-out infinite;
}

@keyframes ambientDrift {
  0%,
  100% {
    background-position: 0% 0%, 100% 100%, 50% 100%, center, center;
  }
  50% {
    background-position: 8% 6%, 92% 94%, 46% 96%, center, center;
  }
}

@media (prefers-reduced-motion: reduce) {
  .ambient-bg {
    animation: none;
  }
}
