:root {
  --bg: #fdf7f0;
  --mushroom-cap: #f4b6c2;
  --mushroom-stem: #f6e7d8;
  --shadow-soft: rgba(0,0,0,0.06);

  --pastel-purple: #c9b6e4;
  --pastel-orange: #f7c59f;
  --pastel-green: #c8e6c9;
  --pastel-blue: #b3e5fc;
  --pastel-yellow: #fff59d;
  --pastel-brown: #d7ccc8;

  --taskbar-bg: rgba(255,255,255,0.9);
  --window-bg: #ffffff;
  --window-border: #e0d7cf;
  --text-main: #4a4a4a;
  --text-soft: #7a7a7a;
  --radius-lg: 18px;
  --radius-md: 12px;
  --radius-sm: 8px;
  --transition-fast: 0.18s ease;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: var(--text-main);
  background: var(--bg);
  overflow: hidden;
}

/* DESKTOP BACKGROUND WITH SUBTLE MUSHROOMS */
#desktop {
  position: relative;
  width: 100vw;
  height: 100vh;
  background:
    radial-gradient(circle at 10% 20%, rgba(244,182,194,0.35) 0, transparent 55%),
    radial-gradient(circle at 80% 80%, rgba(179,229,252,0.35) 0, transparent 55%),
    radial-gradient(circle at 20% 80%, rgba(200,230,201,0.35) 0, transparent 55%),
    radial-gradient(circle at 85% 15%, rgba(255,245,157,0.35) 0, transparent 55%),
    #fdf7f0;
  overflow: hidden;
}

/* Subtle mushroom pattern using emoji */
#desktop::before {
  content: "🍄 🍄 🍄 🍄 🍄";
  position: absolute;
  font-size: 32px;
  opacity: 0.06;
  top: 15%;
  left: 10%;
  letter-spacing: 2rem;
  transform: rotate(-8deg);
  pointer-events: none;
}
#desktop::after {
  content: "🍄 🍄 🍄";
  position: absolute;
  font-size: 28px;
  opacity: 0.05;
  bottom: 18%;
  right: 12%;
  letter-spacing: 2rem;
  transform: rotate(7deg);
  pointer-events: none;
}

/* DESKTOP GRID */
#desktop-grid {
  position: absolute;
  top: 24px;
  left: 24px;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  gap: 16px;
  max-width: 520px;
}

.desktop-icon {
  border: none;
  background: transparent;
  text-align: left;
  cursor: pointer;
  padding: 4px;
}
.desktop-icon-badge {
  width: 64px;
  height: 64px;
  border-radius: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 30px;
  box-shadow: 0 6px 14px var(--shadow-soft);
  margin-bottom: 4px;
}
.desktop-icon-label {
  font-size: 0.8rem;
  color: var(--text-main);
}

/* PASTEL BADGES */
.pastel-purple { background: var(--pastel-purple); }
.pastel-orange { background: var(--pastel-orange); }
.pastel-green  { background: var(--pastel-green); }
.pastel-blue   { background: var(--pastel-blue); }
.pastel-yellow { background: var(--pastel-yellow); }
.pastel-brown  { background: var(--pastel-brown); }

/* TASKBAR */
#taskbar {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 46px;
  background: var(--taskbar-bg);
  backdrop-filter: blur(12px);
  border-top: 1px solid rgba(0,0,0,0.05);
  display: flex;
  align-items: center;
  padding: 0 10px;
  gap: 10px;
}

.taskbar-start {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  border-radius: 999px;
  border: none;
  padding: 4px 10px;
  background: #fbe9e7;
  cursor: pointer;
  box-shadow: 0 3px 8px var(--shadow-soft);
}
.start-orb {
  width: 22px;
  height: 22px;
  border-radius: 999px;
  background: linear-gradient(135deg, #f4b6c2, #f6e7d8);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
}
.start-text {
  font-size: 0.8rem;
  color: var(--text-main);
}

#taskbar-apps {
  flex: 1;
  display: flex;
  align-items: center;
  gap: 6px;
  overflow-x: auto;
}

.taskbar-button {
  border-radius: 999px;
  border: none;
  padding: 4px 10px;
  background: rgba(255,255,255,0.9);
  box-shadow: 0 3px 8px var(--shadow-soft);
  display: inline-flex;
  align-items: center;
  gap: 6px;
  cursor: pointer;
  font-size: 0.8rem;
  white-space: nowrap;
}
.taskbar-button.active {
  background: #ffe0b2;
}

.taskbar-right {
  display: flex;
  align-items: center;
  gap: 10px;
}
.taskbar-icon {
  font-size: 1rem;
}
.taskbar-clock {
  font-size: 0.8rem;
  color: var(--text-soft);
}

/* START MENU */
.start-menu {
  position: absolute;
  bottom: 52px;
  left: 10px;
  width: 360px;
  max-height: 70vh;
  background: rgba(255,255,255,0.96);
  border-radius: 18px;
  box-shadow: 0 18px 40px rgba(0,0,0,0.12);
  padding: 12px 12px 14px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.start-menu.hidden {
  display: none;
}
.start-header {
  display: flex;
  align-items: center;
  gap: 10px;
  padding-bottom: 6px;
  border-bottom: 1px solid rgba(0,0,0,0.05);
}
.start-logo-circle {
  width: 34px;
  height: 34px;
  border-radius: 999px;
  background: linear-gradient(135deg, #f4b6c2, #f6e7d8);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  color: #5d4037;
}
.start-logo-text {
  font-size: 0.9rem;
}
.start-title {
  display: flex;
  flex-direction: column;
}
.start-name {
  font-size: 0.9rem;
  font-weight: 600;
}
.start-sub {
  font-size: 0.75rem;
  color: var(--text-soft);
}

.start-section {
  margin-top: 4px;
}
.start-section-title {
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--text-soft);
  margin-bottom: 4px;
}
.start-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 6px;
}
.start-item {
  border-radius: 12px;
  border: none;
  background: #fdf7f0;
  padding: 6px 6px 8px;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 4px;
  cursor: pointer;
  font-size: 0.75rem;
}
.start-item:hover {
  background: #ffe0b2;
}
.start-icon {
  width: 28px;
  height: 28px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
}
.start-label {
  font-size: 0.75rem;
  color: var(--text-main);
}

/* WINDOW LAYER */
#window-layer {
  position: absolute;
  inset: 0;
  padding: 16px;
  padding-bottom: 60px; /* leave room for taskbar */
  pointer-events: none;
}

/* WINDOWS */
.window {
  position: absolute;
  top: 70px;
  left: 120px;
  width: 720px;
  height: 480px;
  max-width: calc(100% - 40px);
  max-height: calc(100% - 90px);
  background: var(--window-bg);
  border-radius: var(--radius-lg);
  box-shadow: 0 18px 40px rgba(0,0,0,0.18);
  border: 1px solid var(--window-border);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  pointer-events: auto;
}
.window.maximized {
  top: 16px;
  left: 16px;
  width: calc(100% - 32px);
  height: calc(100% - 80px);
}
.window-titlebar {
  height: 34px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 10px;
  background: #fbe9e7;
  border-bottom: 1px solid rgba(0,0,0,0.05);
}
.window-title-left {
  display: flex;
  align-items: center;
  gap: 8px;
}
.window-dot {
  width: 10px;
  height: 10px;
  border-radius: 999px;
}
.window-dot.red { background: #ff8a80; }
.window-dot.yellow { background: #ffd180; }
.window-dot.green { background: #a5d6a7; }

.window-title {
  font-size: 0.8rem;
  font-weight: 600;
}
.window-controls {
  display: flex;
  align-items: center;
  gap: 4px;
}
.window-btn {
  width: 22px;
  height: 22px;
  border-radius: 6px;
  border: none;
  background: transparent;
  font-size: 0.8rem;
  cursor: pointer;
  color: #5d4037;
}
.window-btn:hover {
  background: rgba(255,255,255,0.8);
}

.window-body {
  flex: 1;
  background: #ffffff;
}
.window-body iframe {
  width: 100%;
  height: 100%;
  border: none;
}

/* HIDDEN UTILS */
.hidden {
  display: none !important;
}

/* RESPONSIVE */
@media (max-width: 768px) {
  #desktop-grid {
    max-width: 100%;
    grid-template-columns: repeat(2, minmax(120px, 1fr));
  }
  .window {
    top: 60px;
    left: 10px;
    width: calc(100% - 20px);
    height: calc(100% - 100px);
  }
}