/* Space Bugs — scoped styles to avoid collisions with spudsupport.net */

#spacebugs-app {
  --sb-bg-0: #080914;
  --sb-bg-1: #0f1230;
  --sb-neon-cyan: #52f7ff;
  --sb-neon-magenta: #ff4fd8;
  --sb-neon-yellow: #ffd85b;
  --sb-text: #e8efff;

  color: var(--sb-text);
  font-family: "Trebuchet MS", "Segoe UI", sans-serif;
  background:
    radial-gradient(circle at 15% 20%, rgba(37, 26, 88, 0.95) 0%, transparent 35%),
    radial-gradient(circle at 80% 10%, rgba(18, 56, 109, 0.9) 0%, transparent 40%),
    radial-gradient(circle at 50% 80%, rgba(59, 14, 79, 0.75) 0%, transparent 45%),
    linear-gradient(180deg, rgba(15, 18, 48, 0.98), rgba(8, 9, 20, 0.98));
  border: 1px solid rgba(107, 228, 255, 0.24);
  border-radius: 20px;
  padding: clamp(0.8rem, 1.5vw, 1rem);
  overflow-x: hidden;
  box-shadow:
    inset 0 1px 0 rgba(255,255,255,0.05),
    inset 0 0 0 1px rgba(255,255,255,0.02),
    0 18px 50px rgba(0, 0, 0, 0.35);
}

#spacebugs-app * { box-sizing: border-box; }

#spacebugs-app .sb-app-shell {
  width: 100%;
  max-width: 1000px;
  margin: 0 auto;
}

#spacebugs-app .sb-title-bar {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 0.8rem;
  padding: 0.8rem 0.95rem;
  border: 1px solid rgba(107, 228, 255, 0.16);
  border-radius: 16px;
  background: linear-gradient(180deg, rgba(14, 20, 40, 0.82), rgba(9, 13, 29, 0.72));
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.04);
  position: relative;
  overflow: hidden;
}

#spacebugs-app .sb-title-bar::before {
  content: "";
  position: absolute;
  inset: 0 0 auto 0;
  height: 3px;
  background: linear-gradient(90deg, var(--sb-neon-cyan), var(--sb-neon-magenta), var(--sb-neon-yellow));
  opacity: 0.95;
}

#spacebugs-app .sb-title-bar h1 {
  margin: 0;
  letter-spacing: 0.2rem;
  color: var(--sb-neon-cyan);
  text-shadow: 0 0 16px rgba(82, 247, 255, 0.45);
}

#spacebugs-app .sb-subtitle {
  margin: 0.2rem 0 0;
  opacity: 0.9;
  color: rgba(232, 239, 255, 0.88);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-size: 0.78rem;
}

#spacebugs-app .sb-game-wrap {
  width: min(100%, 960px);
  margin: 0 auto;
  border: 1px solid rgba(107, 228, 255, 0.34);
  border-radius: 18px;
  overflow: hidden;
  box-shadow:
    0 0 34px rgba(82, 247, 255, 0.18),
    inset 0 0 30px rgba(255, 79, 216, 0.06),
    inset 0 1px 0 rgba(255,255,255,0.05);
}

#spacebugs-app canvas {
  width: 100%;
  height: auto;
  display: block;
  background: #05060f;
  image-rendering: pixelated;
  image-rendering: crisp-edges;
  outline: none;
}

#spacebugs-app canvas:focus-visible {
  box-shadow: inset 0 0 0 2px rgba(255, 216, 91, 0.85);
}

#spacebugs-app .sb-hint-bar {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.55rem;
  font-size: 0.82rem;
  opacity: 0.98;
  margin-top: 0.8rem;
}

#spacebugs-app .sb-hint-bar span {
  display: inline-flex;
  align-items: center;
  min-height: 2rem;
  padding: 0.36rem 0.7rem;
  border-radius: 999px;
  border: 1px solid rgba(107, 228, 255, 0.16);
  background: rgba(11, 16, 34, 0.72);
  color: rgba(232, 239, 255, 0.9);
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.03);
}

#spacebugs-app .sb-muted,
#spacebugs .sb-muted {
  opacity: 0.85;
  font-size: 0.9rem;
}

@media (max-width: 860px) {
  #spacebugs-app .sb-title-bar {
    align-items: start;
    flex-direction: column;
  }

  #spacebugs-app .sb-title-bar h1 {
    font-size: clamp(1.35rem, 4vw, 1.8rem);
    letter-spacing: 0.12rem;
  }

  #spacebugs-app .sb-hint-bar {
    gap: 0.45rem;
    font-size: 0.8rem;
  }
}

@media (max-width: 560px) {
  #spacebugs-app {
    border-radius: 14px;
  }

  #spacebugs-app .sb-title-bar,
  #spacebugs-app .sb-game-wrap {
    border-radius: 12px;
  }

  #spacebugs-app .sb-hint-bar {
    justify-content: center;
  }

  #spacebugs-app .sb-hint-bar span {
    width: 100%;
    justify-content: center;
  }
}
