/* DOGE COLONY - base atmosphere & layout */
:root {
  --void: #05080f;
  --deep: #071018;
  --panel: rgba(8, 18, 28, 0.72);
  --panel-border: rgba(120, 190, 210, 0.22);
  --ink: #d7e8f0;
  --muted: #7f9aaa;
  --accent: #c9a227;
  --accent-soft: rgba(201, 162, 39, 0.35);
  --earth: #3d7ea6;
  --moon: #b8c0c8;
  --mars: #c45c3a;
  --ok: #5dbe8a;
  --warn: #d4a017;
  --danger: #d45c5c;
  --font-display: "Orbitron", "Segoe UI", sans-serif;
  --font-body: "IBM Plex Sans", "Segoe UI", sans-serif;
  --radius: 14px;
  --shadow: 0 12px 40px rgba(0, 0, 0, 0.45);
  --hud-blur: blur(14px);
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  height: 100%;
  overflow: hidden;
  background: var(--void);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 14px;
  line-height: 1.45;
}

#app {
  position: relative;
  width: 100%;
  height: 100%;
  isolation: isolate;
}

/* ---- Boot loader ---- */
.boot-loader {
  position: fixed;
  inset: 0;
  z-index: 200;
  display: grid;
  place-items: center;
  padding: 1.5rem;
  background:
    radial-gradient(ellipse at 50% 20%, rgba(201, 162, 39, 0.16), transparent 55%),
    radial-gradient(ellipse at 20% 80%, rgba(61, 126, 166, 0.18), transparent 45%),
    radial-gradient(ellipse at 85% 70%, rgba(196, 92, 58, 0.12), transparent 40%),
    linear-gradient(165deg, #05080f 0%, #0a1520 50%, #071018 100%);
  transition: opacity 0.45s ease, visibility 0.45s ease;
}

.boot-loader.is-done {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

.boot-loader-glow {
  position: absolute;
  width: min(28rem, 80vw);
  height: min(28rem, 80vw);
  border-radius: 50%;
  background: radial-gradient(circle, rgba(201, 162, 39, 0.22), transparent 68%);
  filter: blur(8px);
  animation: boot-pulse 3.2s ease-in-out infinite;
  pointer-events: none;
}

.boot-loader-card {
  position: relative;
  width: min(22rem, 100%);
  text-align: center;
  padding: 2rem 1.5rem 1.6rem;
}

.boot-loader-logo {
  width: 5.5rem;
  height: 5.5rem;
  border-radius: 50%;
  object-fit: cover;
  margin: 0 auto 1.1rem;
  display: block;
  box-shadow:
    0 0 0 1px rgba(255, 220, 120, 0.45),
    0 0 40px rgba(201, 162, 39, 0.35);
  animation: boot-logo-spin 14s linear infinite;
}

.boot-loader-kicker {
  margin: 0;
  font-family: var(--font-display);
  font-size: 0.62rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--accent);
}

.boot-loader-title {
  margin: 0.35rem 0 0.85rem;
  font-size: clamp(1.35rem, 4vw, 1.75rem);
  letter-spacing: 0.08em;
}

.boot-loader-status {
  margin: 0 0 1.15rem;
  min-height: 1.35em;
  color: var(--muted);
  font-size: 0.88rem;
}

.boot-loader-track {
  height: 0.42rem;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(120, 190, 210, 0.18);
  overflow: hidden;
  box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.35);
}

.boot-loader-bar {
  height: 100%;
  width: 0%;
  border-radius: inherit;
  background: linear-gradient(90deg, #8a6b12, var(--accent), #f0d56a);
  box-shadow: 0 0 16px rgba(201, 162, 39, 0.55);
  transition: width 0.08s linear;
}

.boot-loader-pct {
  margin: 0.65rem 0 0;
  font-family: var(--font-display);
  font-size: 0.72rem;
  letter-spacing: 0.12em;
  color: var(--muted);
  font-variant-numeric: tabular-nums;
}

.boot-loader.is-error .boot-loader-bar {
  background: linear-gradient(90deg, #8a2a2a, var(--danger));
  box-shadow: 0 0 16px rgba(212, 92, 92, 0.45);
}

.boot-loader.is-error .boot-loader-status {
  color: var(--danger);
}

body.is-booting #app .hud-panel,
body.is-booting #app .object-tag,
body.is-booting #app .audio-toggle,
body.is-booting #app .mobile-dock {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

body.is-booting #render-canvas {
  opacity: 0;
}

body.is-ready #render-canvas {
  opacity: 1;
  transition: opacity 0.55s ease;
}

body.is-ready #app .hud-panel,
body.is-ready #app .object-tag,
body.is-ready #app .audio-toggle,
body.is-ready #app .mobile-dock {
  opacity: 1;
  visibility: visible;
  transition: opacity 0.55s ease 0.1s;
}

@keyframes boot-pulse {
  0%, 100% { transform: scale(0.92); opacity: 0.55; }
  50% { transform: scale(1.08); opacity: 1; }
}

@keyframes boot-logo-spin {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}

@media (prefers-reduced-motion: reduce) {
  .boot-loader-glow,
  .boot-loader-logo {
    animation: none;
  }
}

#render-canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  display: block;
  outline: none;
  background:
    radial-gradient(ellipse at 30% 20%, #122033 0%, transparent 45%),
    radial-gradient(ellipse at 80% 70%, #1a1210 0%, transparent 40%),
    linear-gradient(160deg, #05080f 0%, #0a1520 50%, #0b0e14 100%);
  z-index: 0;
}

#atmosphere {
  pointer-events: none;
  position: absolute;
  inset: 0;
  z-index: 1;
  overflow: hidden;
}

.nebula {
  position: absolute;
  border-radius: 50%;
  filter: blur(60px);
  opacity: 0.35;
  animation: drift 48s ease-in-out infinite alternate;
}

.nebula-a {
  width: 55vmax;
  height: 55vmax;
  left: -10%;
  top: -15%;
  background: radial-gradient(circle, rgba(61, 126, 166, 0.45), transparent 70%);
}

.nebula-b {
  width: 45vmax;
  height: 45vmax;
  right: -8%;
  bottom: -12%;
  background: radial-gradient(circle, rgba(196, 92, 58, 0.28), transparent 70%);
  animation-duration: 62s;
  animation-direction: alternate-reverse;
}

.scanlines {
  position: absolute;
  inset: 0;
  background: repeating-linear-gradient(
    to bottom,
    transparent 0,
    transparent 3px,
    rgba(0, 0, 0, 0.05) 3px,
    rgba(0, 0, 0, 0.05) 4px
  );
  opacity: 0.35;
  mix-blend-mode: multiply;
}

@keyframes drift {
  from { transform: translate3d(0, 0, 0) scale(1); }
  to { transform: translate3d(4%, 3%, 0) scale(1.08); }
}

h1,
h2,
h3 {
  font-family: var(--font-display);
  font-weight: 700;
  letter-spacing: 0.06em;
  margin: 0;
}

h1 {
  font-size: clamp(1rem, 1.6vw, 1.35rem);
}

h2 {
  font-size: 0.78rem;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 0.65rem;
}

h3.panel-sub {
  font-size: 0.68rem;
  text-transform: uppercase;
  color: var(--muted);
  margin: 0.85rem 0 0.45rem;
}

p {
  margin: 0;
}

button {
  font: inherit;
  cursor: pointer;
  border: none;
  background: none;
  color: inherit;
}

@media (prefers-reduced-motion: reduce) {
  .nebula {
    animation: none;
  }
}
