/*
 * Chromatic dream starfield
 * Distinct rose, cyan, violet, gold and blue zones with a calm Win98 foreground.
 */

:root {
  --window-face: #edd9e7;
  --window-content: #fff9fc;
  --window-mid: #b194ad;
  --window-dark: #5d4563;
  --ink: #35243f;
  --muted: #765f7d;
  --accent: #cf6298;
  --title-a: #75458c;
  --title-b: #d2779e;
  --shadow: rgba(24, 8, 36, 0.56);
}

body {
  background: #11091b;
}

/*
 * The background is no longer one purple wash. Each colour occupies a clear
 * region: rose on the left, peach above centre, cyan on the right and indigo
 * below. The window still sits inside the quietest central band.
 */
.desktop {
  background:
    radial-gradient(ellipse at 13% 27%, rgba(255, 93, 184, 0.34) 0%, rgba(219, 82, 165, 0.17) 16%, transparent 38%),
    radial-gradient(ellipse at 46% 13%, rgba(255, 190, 126, 0.24) 0%, rgba(246, 146, 171, 0.14) 15%, transparent 34%),
    radial-gradient(ellipse at 83% 24%, rgba(67, 222, 255, 0.31) 0%, rgba(69, 157, 230, 0.15) 17%, transparent 39%),
    radial-gradient(ellipse at 67% 43%, rgba(165, 91, 255, 0.24) 0%, transparent 38%),
    radial-gradient(ellipse at 31% 48%, rgba(242, 109, 207, 0.17) 0%, transparent 37%),
    linear-gradient(
      180deg,
      #160a20 0%,
      #2d1238 18%,
      #5c285e 37%,
      #683461 50%,
      #4a3762 65%,
      #252d5c 82%,
      #0d1737 100%
    );
}

/* Broad aurora bands with visible colour separation. */
.desktop::before {
  background:
    linear-gradient(118deg, transparent 9%, rgba(255, 91, 190, 0.22) 28%, transparent 44%),
    linear-gradient(67deg, transparent 42%, rgba(118, 93, 255, 0.17) 56%, transparent 69%),
    linear-gradient(126deg, transparent 58%, rgba(66, 223, 255, 0.21) 74%, transparent 90%),
    radial-gradient(ellipse at 48% 13%, rgba(255, 224, 188, 0.20) 0 9%, transparent 29%),
    radial-gradient(ellipse at 19% 24%, rgba(255, 155, 220, 0.23) 0 8%, transparent 27%),
    radial-gradient(ellipse at 83% 28%, rgba(126, 228, 255, 0.23) 0 9%, transparent 29%);
  filter: blur(58px) saturate(132%);
  opacity: 0.92;
  animation: nebulaDrift 52s ease-in-out infinite alternate;
}

/* Highlight texture without flattening the colours into white. */
.desktop::after {
  background:
    radial-gradient(ellipse at 45% 16%, rgba(255, 238, 205, 0.075) 0 13%, transparent 36%),
    radial-gradient(ellipse at 82% 25%, rgba(186, 247, 255, 0.070) 0 12%, transparent 35%),
    linear-gradient(180deg, transparent 0 17%, rgba(255, 129, 204, 0.040) 31%, rgba(130, 183, 255, 0.032) 48%, transparent 65%, rgba(5, 10, 34, 0.24) 100%),
    radial-gradient(ellipse at center, transparent 32%, rgba(16, 9, 30, 0.10) 67%, rgba(3, 5, 20, 0.56) 100%),
    repeating-linear-gradient(90deg, transparent 0 96px, rgba(255, 225, 245, 0.010) 97px, transparent 98px);
  mix-blend-mode: normal;
  opacity: 1;
}

.cloud-layer {
  filter: blur(68px);
  mix-blend-mode: screen;
}

.cloud-layer-a {
  opacity: 0.50;
  background:
    radial-gradient(ellipse at 11% 26%, rgba(255, 76, 180, 0.31) 0 8%, transparent 26%),
    radial-gradient(ellipse at 48% 14%, rgba(255, 183, 118, 0.24) 0 9%, transparent 27%),
    radial-gradient(ellipse at 88% 24%, rgba(52, 217, 255, 0.29) 0 9%, transparent 28%);
  animation: nebulaFloatA 45s ease-in-out infinite alternate;
}

.cloud-layer-b {
  opacity: 0.42;
  background:
    radial-gradient(ellipse at 29% 39%, rgba(237, 83, 205, 0.22) 0 10%, transparent 29%),
    radial-gradient(ellipse at 66% 39%, rgba(156, 93, 255, 0.23) 0 11%, transparent 30%),
    radial-gradient(ellipse at 77% 18%, rgba(117, 226, 255, 0.16) 0 8%, transparent 25%),
    radial-gradient(ellipse at 51% 23%, rgba(255, 222, 178, 0.12) 0 7%, transparent 22%);
  animation: nebulaFloatB 59s ease-in-out infinite alternate;
}

@keyframes nebulaDrift {
  from { transform: translate3d(-1.3%, 0.8%, 0) scale(1.02); }
  to { transform: translate3d(1.5%, -1.1%, 0) scale(1.07); }
}

@keyframes nebulaFloatA {
  from { transform: translate3d(-1.8%, 0, 0) rotate(-0.5deg); }
  to { transform: translate3d(1.8%, -1.2%, 0) rotate(0.6deg); }
}

@keyframes nebulaFloatB {
  from { transform: translate3d(0.8%, -1%, 0) scale(1); }
  to { transform: translate3d(-1.6%, 1.3%, 0) scale(1.05); }
}

.stars::before {
  content: none !important;
  display: none !important;
}

/* Denser, clearly coloured distant stars. */
.stars::after {
  content: "";
  position: absolute;
  inset: 0;
  opacity: 0.74;
  background-image:
    radial-gradient(circle, rgba(255, 112, 194, .98) 0 1.25px, transparent 1.55px),
    radial-gradient(circle, rgba(74, 226, 255, .98) 0 1.25px, transparent 1.55px),
    radial-gradient(circle, rgba(176, 123, 255, .96) 0 1.25px, transparent 1.55px),
    radial-gradient(circle, rgba(255, 204, 88, .96) 0 1.2px, transparent 1.5px),
    radial-gradient(circle, rgba(83, 244, 177, .92) 0 1.2px, transparent 1.5px),
    radial-gradient(circle, rgba(118, 166, 255, .94) 0 1.2px, transparent 1.5px);
  background-size: 179px 207px, 257px 239px, 331px 281px, 397px 347px, 487px 409px, 557px 461px;
  background-position: 29px 41px, 111px 17px, 71px 131px, 203px 83px, 23px 177px, 281px 51px;
  animation: distantStars 9s ease-in-out infinite alternate;
}

@keyframes distantStars {
  from { opacity: 0.48; }
  to { opacity: 0.80; }
}

/* Named palette classes are assigned by starfield.js. */
.star {
  --star-core: #ff78c8;
  --star-glow: rgba(255, 78, 181, .92);
  --star-halo: rgba(255, 45, 154, .30);
  --star-ray: rgba(255, 221, 243, .99);
  position: absolute;
  width: 2.5px;
  height: 2.5px;
  border-radius: 50%;
  background: var(--star-core);
  box-shadow: 0 0 8px 1.5px var(--star-glow), 0 0 21px 5px var(--star-halo);
  transform-origin: center;
  animation: twinkle var(--duration, 4s) ease-in-out infinite;
  animation-delay: var(--delay, 0s);
}

.star.pink {
  --star-core: #ff78c8;
  --star-glow: rgba(255, 78, 181, .92);
  --star-halo: rgba(255, 45, 154, .30);
  --star-ray: rgba(255, 221, 243, .99);
}

.star.cyan {
  --star-core: #55eaff;
  --star-glow: rgba(50, 224, 255, .94);
  --star-halo: rgba(29, 187, 255, .31);
  --star-ray: rgba(215, 252, 255, .99);
}

.star.violet {
  --star-core: #b58cff;
  --star-glow: rgba(158, 112, 255, .94);
  --star-halo: rgba(122, 73, 255, .30);
  --star-ray: rgba(237, 226, 255, .99);
}

.star.gold {
  --star-core: #ffd166;
  --star-glow: rgba(255, 190, 62, .94);
  --star-halo: rgba(255, 147, 36, .28);
  --star-ray: rgba(255, 244, 207, .99);
}

.star.mint {
  --star-core: #78ffd0;
  --star-glow: rgba(62, 244, 175, .91);
  --star-halo: rgba(35, 205, 143, .27);
  --star-ray: rgba(221, 255, 242, .99);
}

.star.blue {
  --star-core: #8fb7ff;
  --star-glow: rgba(99, 154, 255, .92);
  --star-halo: rgba(63, 103, 232, .27);
  --star-ray: rgba(228, 238, 255, .99);
}

.star.medium {
  width: 3.5px;
  height: 3.5px;
  box-shadow: 0 0 9px 2px var(--star-glow), 0 0 23px 6px var(--star-halo);
}

.star.large {
  width: 5px;
  height: 5px;
  z-index: 1;
  background: var(--star-core);
  box-shadow: 0 0 10px 2.5px var(--star-glow), 0 0 28px 8px var(--star-halo);
}

.star.large::before,
.star.large::after {
  content: "";
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  pointer-events: none;
  filter: drop-shadow(0 0 6px var(--star-glow));
}

.star.large::before {
  width: clamp(38px, 5.3vw, 78px);
  height: 1.5px;
  background: linear-gradient(90deg, transparent, var(--star-ray), transparent);
}

.star.large::after {
  width: 1.5px;
  height: clamp(42px, 6.4vw, 94px);
  background: linear-gradient(180deg, transparent, var(--star-ray), transparent);
}

@keyframes twinkle {
  0%, 100% { opacity: .44; transform: scale(.84); filter: brightness(.90); }
  45% { opacity: 1; transform: scale(1.14); filter: brightness(1.22); }
  60% { opacity: .84; transform: scale(.98); filter: brightness(1.05); }
}

.window {
  box-shadow:
    inset 1px 1px 0 rgba(255,255,255,.74),
    inset -1px -1px 0 var(--window-mid),
    8px 9px 0 rgba(18, 5, 30, 0.58),
    0 0 40px rgba(255, 151, 217, 0.12),
    0 0 54px rgba(79, 207, 255, 0.06);
}

.titlebar {
  background: linear-gradient(90deg, #70458f 0%, #8f4f91 34%, #bb5f91 65%, #dd7ca0 100%);
}

.window-cat {
  filter:
    drop-shadow(3px 4px 0 rgba(18, 5, 30, 0.40))
    drop-shadow(0 0 12px rgba(255, 163, 220, 0.22));
}

.desktop-shortcut {
  color: #fff6fc;
  text-shadow: 1px 1px 0 #1d1027, 0 0 8px rgba(255, 112, 200, 0.22);
}

.desktop-shortcut:focus-visible,
.desktop-shortcut:hover {
  outline-color: rgba(255, 246, 251, 0.92);
  background: rgba(194, 109, 168, 0.14);
}

.taskbar {
  background: #e8d6e4;
  box-shadow: inset 0 1px 0 rgba(255,255,255,.92), 0 -5px 18px rgba(18, 5, 30, 0.20);
}

.closed-dialog {
  box-shadow: 7px 8px 0 rgba(18, 5, 30, 0.55);
}

.crt-overlay {
  opacity: .026;
}

@media (max-width: 620px) {
  .desktop {
    background:
      radial-gradient(ellipse at 12% 24%, rgba(255, 88, 185, 0.31) 0%, transparent 37%),
      radial-gradient(ellipse at 48% 11%, rgba(255, 193, 127, 0.20) 0%, transparent 32%),
      radial-gradient(ellipse at 86% 23%, rgba(67, 221, 255, 0.28) 0%, transparent 38%),
      radial-gradient(ellipse at 65% 42%, rgba(164, 92, 255, 0.22) 0%, transparent 37%),
      linear-gradient(180deg, #160a20 0%, #31143c 19%, #62305f 40%, #6a3864 53%, #41406a 72%, #111b3e 100%);
  }

  .star.large::before {
    width: 34px;
  }

  .star.large::after {
    height: 42px;
  }
}
